MCPcopy
hub / github.com/ory/keto / NewCreateCmd

Function NewCreateCmd

cmd/relationtuple/create.go:14–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12const FlagFile = "file"
13
14func NewCreateCmd() *cobra.Command {
15 cmd := &cobra.Command{
16 Use: "create <subject_namespace>:<subject_id> <relation> <object_namespace>:<object_id>",
17 Short: "Create relationship tuples from inline arguments or JSON files and folders",
18 Long: "Create relationship tuples from inline arguments or JSON files and folders.\n\n" +
19 "Inline example:\n" +
20 " keto relation-tuple create User:alice owner Doc:readme\n\n" +
21
22 "From file or folder:\n" +
23 " keto relation-tuple create -f relationships1.json -f relationships2.json\n" +
24 " keto relation-tuple create -f relationships-dir1 -f relationships-dir2\n\n" +
25
26 "If a directory is provided, all JSON files inside it are processed.\n" +
27 "Use '-' as filename to read from STD_IN:\n" +
28 " keto relation-tuple create -f -",
29 Args: cobra.ArbitraryArgs,
30 RunE: transactTuples(rts.RelationTupleDelta_ACTION_INSERT),
31 }
32
33 registerFileFlag(cmd.Flags())
34 registerPackageFlags(cmd.Flags())
35
36 return cmd
37}

Callers 1

Calls 3

transactTuplesFunction · 0.85
registerFileFlagFunction · 0.85
registerPackageFlagsFunction · 0.85

Tested by

no test coverage detected