2025-01-21 16:42:59 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
var actionCmd = &cobra.Command{
|
|
|
|
Use: "action",
|
|
|
|
Short: "Manage and run source actions",
|
2025-01-23 16:22:50 +00:00
|
|
|
Long: `Add, edit, delete, and run source actions on items.
|
|
|
|
|
|
|
|
A feed source is updated by the "fetch" action, which receives no input and
|
|
|
|
returns one JSON item per line on stdout. Other source actions are run on a
|
|
|
|
specific item, receiving that item on stdin and expecting that item, with any
|
|
|
|
modifications made by the action, on stdout.
|
|
|
|
|
|
|
|
Items declare support for an action by having an "action" key containing an
|
|
|
|
object with a key for every supported action. The value of that key may be
|
|
|
|
any arbitrary JSON value. Use --force to execute an unsupported action anyway,
|
|
|
|
though the action may fail if it operated on the item's action data.
|
|
|
|
|
|
|
|
To execute the "fetch" action, use "intake source fetch".`,
|
2025-01-21 16:42:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
rootCmd.AddCommand(actionCmd)
|
|
|
|
}
|