Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion internal/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ zed permission check --explain document:firstdoc writer user:emilia

relCmd := commands.RegisterRelationshipCmd(rootCmd)

commands.RegisterWatchCmd(rootCmd)
commands.RegisterWatchRelationshipCmd(relCmd)

schemaCmd := commands.RegisterSchemaCmd(rootCmd)
Expand Down
10 changes: 0 additions & 10 deletions internal/cmd/preview.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,9 @@ import (

func registerPreviewCmd(rootCmd *cobra.Command) {
rootCmd.AddCommand(previewCmd)

previewCmd.AddCommand(schemaCmd)

schemaCmd.AddCommand(schemaCompileCmd)
}

var previewCmd = &cobra.Command{
Use: "preview <subcommand>",
Short: "Experimental commands that have been made available for preview",
}

var schemaCmd = &cobra.Command{
Use: "schema <subcommand>",
Short: "Manage schema for a permissions system",
Deprecated: "please use `zed schema compile`",
}
33 changes: 0 additions & 33 deletions internal/commands/permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ func consistencyFromCmd(cmd *cobra.Command) (c *v1.Consistency, err error) {
c = &v1.Consistency{Requirement: &v1.Consistency_AtLeastAsFresh{AtLeastAsFresh: &v1.ZedToken{Token: atLeast}}}
}

// Deprecated (hidden) flag.
if revision := cobrautil.MustGetStringExpanded(cmd, "revision"); revision != "" {
if c != nil {
return nil, ErrMultipleConsistencies
}
c = &v1.Consistency{Requirement: &v1.Consistency_AtLeastAsFresh{AtLeastAsFresh: &v1.ZedToken{Token: revision}}}
}

if exact := cobrautil.MustGetStringExpanded(cmd, "consistency-at-exactly"); exact != "" {
if c != nil {
return nil, ErrMultipleConsistencies
Expand All @@ -73,38 +65,24 @@ func RegisterPermissionCmd(rootCmd *cobra.Command) *cobra.Command {

permissionCmd.AddCommand(checkCmd)
checkCmd.Flags().Bool("json", false, "output as JSON")
checkCmd.Flags().String("revision", "", "optional revision at which to check")
_ = checkCmd.Flags().MarkHidden("revision")
checkCmd.Flags().Bool("explain", false, "requests debug information from SpiceDB and prints out a trace of the requests")
checkCmd.Flags().Bool("schema", false, "requests debug information from SpiceDB and prints out the schema used")
checkCmd.Flags().Bool("error-on-no-permission", false, "if true, zed will return exit code 1 if subject does not have unconditional permission")
checkCmd.Flags().String("caveat-context", "", "the caveat context to send along with the check, in JSON form")
registerConsistencyFlags(checkCmd.Flags())

permissionCmd.AddCommand(checkBulkCmd)
checkBulkCmd.Flags().String("revision", "", "optional revision at which to check")
Copy link
Contributor

@miparnisari miparnisari Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one wasn't marked as hidden, can we actually remove it?

i also see this

readCmd.Flags().String("revision", "", "optional revision at which to check")
_ = readCmd.Flags().MarkHidden("revision")

checkBulkCmd.Flags().Bool("json", false, "output as JSON")
checkBulkCmd.Flags().Bool("explain", false, "requests debug information from SpiceDB and prints out a trace of the requests")
checkBulkCmd.Flags().Bool("schema", false, "requests debug information from SpiceDB and prints out the schema used")
registerConsistencyFlags(checkBulkCmd.Flags())

permissionCmd.AddCommand(expandCmd)
expandCmd.Flags().Bool("json", false, "output as JSON")
expandCmd.Flags().String("revision", "", "optional revision at which to check")
registerConsistencyFlags(expandCmd.Flags())

// NOTE: `lookup` is an alias of `lookup-resources` (below)
// and must have the same list of flags in order for it to work.
permissionCmd.AddCommand(lookupCmd)
lookupCmd.Flags().Bool("json", false, "output as JSON")
lookupCmd.Flags().String("revision", "", "optional revision at which to check")
lookupCmd.Flags().String("caveat-context", "", "the caveat context to send along with the lookup, in JSON form")
lookupCmd.Flags().Uint32("page-limit", 0, "limit of relations returned per page")
registerConsistencyFlags(lookupCmd.Flags())

permissionCmd.AddCommand(lookupResourcesCmd)
lookupResourcesCmd.Flags().Bool("json", false, "output as JSON")
lookupResourcesCmd.Flags().String("revision", "", "optional revision at which to check")
lookupResourcesCmd.Flags().String("caveat-context", "", "the caveat context to send along with the lookup, in JSON form")
lookupResourcesCmd.Flags().Uint32("page-limit", 0, "limit of relations returned per page")
lookupResourcesCmd.Flags().String("cursor", "", "resume pagination from a specific cursor token")
Expand All @@ -113,7 +91,6 @@ func RegisterPermissionCmd(rootCmd *cobra.Command) *cobra.Command {

permissionCmd.AddCommand(lookupSubjectsCmd)
lookupSubjectsCmd.Flags().Bool("json", false, "output as JSON")
lookupSubjectsCmd.Flags().String("revision", "", "optional revision at which to check")
lookupSubjectsCmd.Flags().String("caveat-context", "", "the caveat context to send along with the lookup, in JSON form")
registerConsistencyFlags(lookupSubjectsCmd.Flags())

Expand Down Expand Up @@ -157,16 +134,6 @@ var lookupResourcesCmd = &cobra.Command{
RunE: lookupResourcesCmdFunc,
}

var lookupCmd = &cobra.Command{
Use: "lookup <type> <permission> <subject:id>",
Short: "Enumerates the resources of a given type for which the subject has permission",
Args: ValidationWrapper(cobra.ExactArgs(3)),
ValidArgsFunction: GetArgs(ResourceType, Permission, SubjectID),
RunE: lookupResourcesCmdFunc,
Deprecated: "prefer lookup-resources",
Hidden: true,
}

var lookupSubjectsCmd = &cobra.Command{
Use: "lookup-subjects <resource:id> <permission> <subject_type#optional_subject_relation>",
Short: "Enumerates the subjects of a given type for which the subject has permission on the resource",
Expand Down
2 changes: 0 additions & 2 deletions internal/commands/relationship.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ func RegisterRelationshipCmd(rootCmd *cobra.Command) *cobra.Command {
bulkDeleteCmd.Flags().Bool("force", false, "force deletion of all elements in batches defined by <optional-limit>")
bulkDeleteCmd.Flags().String("subject-filter", "", "optional subject filter")
bulkDeleteCmd.Flags().Uint32("optional-limit", 1000, "the max amount of elements to delete. If you want to delete all in batches of size <optional-limit>, set --force to true")
bulkDeleteCmd.Flags().Bool("estimate-count", true, "estimate the count of relationships to be deleted")
_ = bulkDeleteCmd.Flags().MarkDeprecated("estimate-count", "no longer used, make use of --optional-limit instead")
return relationshipCmd
}

Expand Down
17 changes: 0 additions & 17 deletions internal/commands/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ var (
watchRelationshipFilters []string
)

func RegisterWatchCmd(rootCmd *cobra.Command) *cobra.Command {
rootCmd.AddCommand(watchCmd)

watchCmd.Flags().StringSliceVar(&watchObjectTypes, "object_types", nil, "optional object types to watch updates for")
watchCmd.Flags().StringVar(&watchRevision, "revision", "", "optional revision at which to start watching")
watchCmd.Flags().BoolVar(&watchTimestamps, "timestamp", false, "shows timestamp of incoming update events")
return watchCmd
}

func RegisterWatchRelationshipCmd(parentCmd *cobra.Command) *cobra.Command {
parentCmd.AddCommand(watchRelationshipsCmd)
watchRelationshipsCmd.Flags().StringSliceVar(&watchObjectTypes, "object_types", nil, "optional object types to watch updates for")
Expand All @@ -45,14 +36,6 @@ func RegisterWatchRelationshipCmd(parentCmd *cobra.Command) *cobra.Command {
return watchRelationshipsCmd
}

var watchCmd = &cobra.Command{
Use: "watch [object_types, ...] [start_cursor]",
Short: "Watches the stream of relationship updates and schema updates from the server",
Args: ValidationWrapper(cobra.RangeArgs(0, 2)),
RunE: watchCmdFunc,
Deprecated: "please use `zed relationships watch` instead",
}

var watchRelationshipsCmd = &cobra.Command{
Use: "watch [object_types, ...] [start_cursor]",
Short: "Watches the stream of relationship updates and schema updates from the server",
Expand Down
Loading