Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
5fb4df4
feat(tags): add tags list pipe
rutvik-gs Jul 13, 2026
4dbea92
test(tags): service + command unit tests
rutvik-gs Jul 14, 2026
7b7f8c1
docs/e2e(tags): help goldens, root.out regen, TAGS.md
rutvik-gs Jul 14, 2026
a861360
feat(tags): add tags get command + TagID identifier
rutvik-gs Jul 14, 2026
7cf3974
test(tags): get service + command + TagID tests
rutvik-gs Jul 14, 2026
5a95a34
docs/e2e(tags): get help golden, tags.out regen, update.sh
rutvik-gs Jul 14, 2026
ec05249
feat(tags): add tags create command
rutvik-gs Jul 15, 2026
ab8cb9a
test(tags): create service + command tests
rutvik-gs Jul 15, 2026
b6ddb1d
docs/e2e(tags): create help golden, tags.out regen
rutvik-gs Jul 15, 2026
472d9db
feat(tags): add tags update command
rutvik-gs Jul 20, 2026
2df4e9c
test(tags): update service + command tests
rutvik-gs Jul 20, 2026
281fd05
docs/e2e(tags): update help golden, tags.out regen, update.sh
rutvik-gs Jul 20, 2026
c27b686
feat(tags): add tags delete command + confirm helper
rutvik-gs Jul 20, 2026
8f6b86d
test(tags): delete service + command tests
rutvik-gs Jul 20, 2026
5b831b1
docs/e2e(tags): delete help golden, tags/get/update help regen
rutvik-gs Jul 20, 2026
ffbbcb7
feat(tags): resolve tag name to UUID for update and delete
rutvik-gs Jul 21, 2026
49e5414
fix(tags): reject empty tag identifier before resolving
rutvik-gs Jul 21, 2026
9470124
feat(tags): add tags assign command + per-asset assignment
rutvik-gs Jul 22, 2026
f341fd2
test(tags): assign service + command tests
rutvik-gs Jul 22, 2026
51b3a1d
docs/e2e(tags): assign help golden, tags.out regen
rutvik-gs Jul 22, 2026
28efc8b
feat(tags): add tags unassign command + per-asset unassignment
rutvik-gs Jul 23, 2026
b3e8da7
test(tags): unassign service + command tests
rutvik-gs Jul 23, 2026
77f0bb5
docs/e2e(tags): unassign help golden + offline fixtures, tags.out regen
rutvik-gs Jul 23, 2026
fea7d59
refactor(tags): share asset gather+classify between assign and unassign
rutvik-gs Jul 24, 2026
568688c
fix(tags): satisfy gocritic unlambda in unassign tests
rutvik-gs Jul 24, 2026
71a9328
feat(tags): add tags assignments command + shared paginator
rutvik-gs Jul 27, 2026
bbdaba6
test(tags): assignments service + command tests
rutvik-gs Jul 27, 2026
5f77a66
docs/e2e(tags): assignments help golden + offline fixtures
rutvik-gs Jul 27, 2026
fc787a2
docs/e2e(tags): regenerate help goldens after rebase onto main
rutvik-gs Jul 28, 2026
ccf9b0c
chore(mocks): regenerate umbrella client mock via go generate
rutvik-gs Jul 28, 2026
016b62d
chore(deps): bump censys-sdk-go to v0.25.26 for GetTagOperation
rutvik-gs Jul 27, 2026
ce5357c
feat(tags): add tags operations list and get with wait support
rutvik-gs Jul 27, 2026
e6adc46
test(tags): operations service + command tests
rutvik-gs Jul 28, 2026
fa3ebdf
refactor(tags): validate --created-by as a UUID on list and assignments
rutvik-gs Jul 28, 2026
b1e07ff
docs/e2e(tags): operations help goldens + offline fixtures
rutvik-gs Jul 28, 2026
7219f4a
docs/e2e(tags): regenerate operations goldens after rebase onto main
rutvik-gs Jul 28, 2026
2441166
feat(tags): add bulk assign via --query
rutvik-gs Jul 28, 2026
7fbde0d
test(tags): bulk assign service + command tests
rutvik-gs Jul 28, 2026
a11972d
docs/e2e(tags): assign help golden + bulk validation fixtures
rutvik-gs Jul 28, 2026
9d2d223
feat(tags): add bulk unassign via --all and time filters
rutvik-gs Jul 29, 2026
7e86627
test(tags): bulk unassign service + command tests
rutvik-gs Jul 29, 2026
89711b1
feat(tags): add tags operations cancel
rutvik-gs Jul 29, 2026
def5f3e
test(tags): operations cancel service + command tests
rutvik-gs Jul 29, 2026
7bbcaf3
docs/e2e(tags): bulk unassign + operations cancel goldens and fixtures
rutvik-gs Jul 29, 2026
a0d8a9a
docs(tags): document the full tags command surface
rutvik-gs Jul 30, 2026
5fecafa
fix(ui): pin the confirm prompt to stderr
rutvik-gs Aug 3, 2026
503aeea
docs(tags): document the 100,000 asset ceiling on bulk jobs
rutvik-gs Aug 3, 2026
f1bc7ff
refactor(tags): scope --yes to delete and bulk assign/unassign
rutvik-gs Aug 3, 2026
869e783
feat(tags): always report the asset count on get
rutvik-gs Aug 3, 2026
6e3cf38
fix(tags): report every per-asset failure, readably
rutvik-gs Aug 3, 2026
68c38af
fix(tags): reject a repeated --asset filter
rutvik-gs Aug 3, 2026
7925219
fix(tags): make a UUID-shaped tag name usable
rutvik-gs Aug 3, 2026
3c347f5
empty commit
rutvik-gs Aug 4, 2026
a708b57
empty commit
btschwartz12 Aug 4, 2026
da52ed3
empty commit
rutvik-gs Aug 4, 2026
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ The `censeye` command allows you to perform a Censeye scan on a host. See the [c

This is a WIP. See the [history command docs](./docs/commands/HISTORY.md) for more details.

### Tags

The `tags` command lets you label and organize assets. You can manage tags themselves (`list`, `get`, `create`, `update`, `delete`), assign and unassign them on hosts, certificates, and web properties, and list what a tag is assigned to. Assets can be given as arguments, read from a file or STDIN, or selected in bulk by a CenQL query — bulk changes run as asynchronous jobs you can track, wait on, and cancel with `censys tags operations`. See the [tags command docs](./docs/commands/TAGS.md) for more details.

### Other Commands

- `$ censys org`: manage and view organization details. See the [org command docs](./docs/commands/ORG.md) for more details.
Expand Down
1 change: 1 addition & 0 deletions cmd/cencli/e2e/fixtures/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ func Fixtures() map[string][]Fixture {
"history": historyFixtures,
"credits": creditsFixtures,
"org": orgFixtures,
"tags": tagsFixtures,
}
}
26 changes: 26 additions & 0 deletions cmd/cencli/e2e/fixtures/golden/golden.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,30 @@ var (
OrgCreditsHelpStdout []byte
//go:embed org_help.out
OrgHelpStdout []byte
//go:embed tags_help.out
TagsHelpStdout []byte
//go:embed tags_list_help.out
TagsListHelpStdout []byte
//go:embed tags_get_help.out
TagsGetHelpStdout []byte
//go:embed tags_create_help.out
TagsCreateHelpStdout []byte
//go:embed tags_update_help.out
TagsUpdateHelpStdout []byte
//go:embed tags_delete_help.out
TagsDeleteHelpStdout []byte
//go:embed tags_assign_help.out
TagsAssignHelpStdout []byte
//go:embed tags_unassign_help.out
TagsUnassignHelpStdout []byte
//go:embed tags_assignments_help.out
TagsAssignmentsHelpStdout []byte
//go:embed tags_operations_help.out
TagsOperationsHelpStdout []byte
//go:embed tags_operations_list_help.out
TagsOperationsListHelpStdout []byte
//go:embed tags_operations_get_help.out
TagsOperationsGetHelpStdout []byte
//go:embed tags_operations_cancel_help.out
TagsOperationsCancelHelpStdout []byte
)
1 change: 1 addition & 0 deletions cmd/cencli/e2e/fixtures/golden/root.out
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Available Commands:
history Retrieve historical data for hosts, web properties, and certificates
org Manage and view organization details
search Execute a search query across Censys data
tags Manage tags and tag assignments for your organization
version Print version information
view Retrieve information about hosts, certificates, and web properties

Expand Down
46 changes: 46 additions & 0 deletions cmd/cencli/e2e/fixtures/golden/tags_assign_help.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Assign a tag, by its name or UUID, to one or more assets (host IPs, certificate SHA-256
fingerprints, or web property hostname:port).

Assets can be passed as positional arguments or read from a file (or STDIN) with
--input-file. Assets of different types can be mixed in a single call. Each asset is
assigned independently: if one fails the rest still proceed, and the per-asset outcomes
are reported.

Use --query instead to assign the tag to every asset matching a CenQL query. That starts
an asynchronous bulk job and reports the operation tracking it; the two input modes cannot
be combined. Bulk assignment always asks for confirmation unless --yes is set.

Usage:
censys tags assign <tag> [asset...] [flags]

Examples:
censys tags assign <tag> <ip-address>
censys tags assign <tag> <ip-address> <ip-address>
censys tags assign <tag> <hostname:port>
censys tags assign <tag> <sha256-fingerprint>
censys tags assign <tag> <ip-address> <hostname:port> # asset types can be mixed
censys tags assign <tag> --input-file <file>
censys tags assign <tag> --input-file - # read assets from STDIN
censys tags assign <tag> --query 'host.services.port: 22' # assign every matching asset
censys tags assign <tag> --query 'host.services.port: 22' --max-assets 1000
censys tags assign <tag> --query 'host.services.port: 22' --wait # poll until the job finishes

Flags:
-h, --help help for assign
-i, --input-file string file to read the assets from (or - for STDIN). Overrides positional asset arguments.
--max-assets int cap the number of assets a bulk job tags (requires --query). The effective cap is the smaller of this and your plan's tag asset limit.
-o, --org-id string organization ID to target (personal access tokens only)
--query string CenQL query selecting the assets to tag. Starts a bulk job instead of assigning explicit assets.
--timeout string how long to wait before giving up (requires --wait) - use 0 for no limit (default "30m0s")
-w, --wait poll the bulk job until it reaches a final status (requires --query)
-y, --yes skip the confirmation prompt (requires --query)

Global Flags:
--debug enable debug logging
--no-color disable ANSI colors and styles
--no-spinner disable spinner during operations
-O, --output-format string output format (json|yaml|tree|short|template) (default "short")
-q, --quiet suppress non-essential output
-S, --streaming enable streaming output mode (NDJSON) for commands that support it
--timeout-http duration per-request timeout for HTTP requests (e.g. 10s, 1m) - use 0 to disable

37 changes: 37 additions & 0 deletions cmd/cencli/e2e/fixtures/golden/tags_assignments_help.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
List the assets a tag, given by its name or UUID, is assigned to.

Results can be filtered by asset, asset type, creator, and creation time. Use --streaming
to emit each assignment as NDJSON as it is fetched.

Usage:
censys tags assignments <tag> [flags]

Examples:
censys tags assignments my-tag # List a tag's assignments
censys tags assignments my-tag --asset-type host # Only host assignments
censys tags assignments my-tag --asset <ip-address> # Check whether one asset is assigned
censys tags assignments my-tag --created-after 2025-01-01T00:00:00Z # Only recent assignments
censys tags assignments my-tag --max-pages -1 # Fetch every page
censys tags assignments my-tag --streaming # Emit NDJSON as assignments are fetched

Flags:
--asset strings filter by one asset (host IP, certificate SHA-256 fingerprint, or web property hostname:port) - giving more than one is an error
--asset-type string filter by asset type (host, web_property, certificate)
--created-after string only assignments created after this time
--created-before string only assignments created before this time
--created-by string filter by the UUID of the assignment's creator
-h, --help help for assignments
-p, --max-pages int maximum number of pages to fetch (-1 for all pages) (default 1)
--order-by string sort order (create_time_asc, create_time_desc)
-o, --org-id string organization ID to target (personal access tokens only)
-n, --page-size int number of assignments to return per page (default 100)

Global Flags:
--debug enable debug logging
--no-color disable ANSI colors and styles
--no-spinner disable spinner during operations
-O, --output-format string output format (json|yaml|tree|short|template) (default "short")
-q, --quiet suppress non-essential output
-S, --streaming enable streaming output mode (NDJSON) for commands that support it
--timeout-http duration per-request timeout for HTTP requests (e.g. 10s, 1m) - use 0 to disable

28 changes: 28 additions & 0 deletions cmd/cencli/e2e/fixtures/golden/tags_create_help.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Create a new tag with the given name.

Tag names must be unique within an organization. New tags are private by default; use
--privacy shared to make a tag visible to all organization members.

Usage:
censys tags create <name> [flags]

Examples:
censys tags create my-tag # Create a private tag
censys tags create my-tag --privacy shared # Create a shared tag
censys tags create my-tag --description "Assets flagged for review" # Create a tag with a description

Flags:
--description string a human-readable description of the tag
-h, --help help for create
-o, --org-id string organization ID to target (personal access tokens only)
--privacy string tag visibility (private, shared) (default "private")

Global Flags:
--debug enable debug logging
--no-color disable ANSI colors and styles
--no-spinner disable spinner during operations
-O, --output-format string output format (json|yaml|tree|short|template) (default "short")
-q, --quiet suppress non-essential output
-S, --streaming enable streaming output mode (NDJSON) for commands that support it
--timeout-http duration per-request timeout for HTTP requests (e.g. 10s, 1m) - use 0 to disable

26 changes: 26 additions & 0 deletions cmd/cencli/e2e/fixtures/golden/tags_delete_help.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Delete a tag by its name or UUID. This cannot be undone.

You are prompted to confirm before the tag is deleted. Use --yes to skip the prompt; in a
non-interactive terminal --yes is required.

Usage:
censys tags delete <tag> [flags]

Examples:
censys tags delete my-tag # Delete a tag by name (prompts for confirmation)
censys tags delete my-tag --yes # Delete without confirming

Flags:
-h, --help help for delete
-o, --org-id string organization ID to target (personal access tokens only)
-y, --yes skip the confirmation prompt

Global Flags:
--debug enable debug logging
--no-color disable ANSI colors and styles
--no-spinner disable spinner during operations
-O, --output-format string output format (json|yaml|tree|short|template) (default "short")
-q, --quiet suppress non-essential output
-S, --streaming enable streaming output mode (NDJSON) for commands that support it
--timeout-http duration per-request timeout for HTTP requests (e.g. 10s, 1m) - use 0 to disable

30 changes: 30 additions & 0 deletions cmd/cencli/e2e/fixtures/golden/tags_get_help.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Retrieve a single tag by its name or UUID.

Tag names are unique within an organization, so a name and its ID can be used
interchangeably.

The tag payload carries no assignment count, so counting the assets it is assigned to
costs a second request. That count is always reported; if only the count fails, the tag is
still printed and the count error follows it.

Usage:
censys tags get <tag> [flags]

Examples:
censys tags get my-tag # Get a tag by name
censys tags get <tag-id> # Get a tag by UUID
censys tags get my-tag --output-format json # Output as JSON

Flags:
-h, --help help for get
-o, --org-id string organization ID to target (personal access tokens only)

Global Flags:
--debug enable debug logging
--no-color disable ANSI colors and styles
--no-spinner disable spinner during operations
-O, --output-format string output format (json|yaml|tree|short|template) (default "short")
-q, --quiet suppress non-essential output
-S, --streaming enable streaming output mode (NDJSON) for commands that support it
--timeout-http duration per-request timeout for HTTP requests (e.g. 10s, 1m) - use 0 to disable

32 changes: 32 additions & 0 deletions cmd/cencli/e2e/fixtures/golden/tags_help.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Manage tags and tag assignments for your organization.

Use --org-id on any subcommand to target a different organization; otherwise your stored
organization ID is used.

Usage:
censys tags [flags]
censys tags [command]

Available Commands:
assign Assign a tag to one or more assets
assignments List the assets a tag is assigned to
create Create a new tag
delete Delete a tag
get Retrieve a single tag by name or ID
list List all tags
operations Track the asynchronous jobs created by bulk tag operations
unassign Unassign a tag from one or more assets
update Update an existing tag

Flags:
-h, --help help for tags

Global Flags:
--debug enable debug logging
--no-color disable ANSI colors and styles
--no-spinner disable spinner during operations
-O, --output-format string output format (json|yaml|tree|short|template) (default "short")
-q, --quiet suppress non-essential output
-S, --streaming enable streaming output mode (NDJSON) for commands that support it
--timeout-http duration per-request timeout for HTTP requests (e.g. 10s, 1m) - use 0 to disable

33 changes: 33 additions & 0 deletions cmd/cencli/e2e/fixtures/golden/tags_list_help.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
List all tags in your organization.

Results can be filtered by privacy, name, and creator, and sorted by various fields.

Usage:
censys tags list [flags]

Examples:
censys tags list # List all tags
censys tags list --privacy shared # List only shared tags
censys tags list --name my-tag # Filter by exact name
censys tags list --order-by name_desc # Sort by name descending
censys tags list --output-format json # Output as JSON

Flags:
--created-by string filter by the UUID of the tag's creator
-h, --help help for list
-p, --max-pages int maximum number of pages to fetch (-1 for all pages) (default 1)
--name string filter by exact tag name
--order-by string sort order (name_asc, name_desc, created_at_asc, created_at_desc, updated_at_asc, updated_at_desc)
-o, --org-id string organization ID to target (personal access tokens only)
-n, --page-size int number of tags to return per page (default 100)
--privacy string filter by privacy (private, shared)

Global Flags:
--debug enable debug logging
--no-color disable ANSI colors and styles
--no-spinner disable spinner during operations
-O, --output-format string output format (json|yaml|tree|short|template) (default "short")
-q, --quiet suppress non-essential output
-S, --streaming enable streaming output mode (NDJSON) for commands that support it
--timeout-http duration per-request timeout for HTTP requests (e.g. 10s, 1m) - use 0 to disable

26 changes: 26 additions & 0 deletions cmd/cencli/e2e/fixtures/golden/tags_operations_cancel_help.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Cancel a running bulk tag operation, identified by the tag it belongs to, given by name or
UUID, and the operation's UUID.

Cancelling stops the job from processing any more assets; it does not undo the assignments
it has already made or removed. An operation that has already finished cannot be
cancelled.

Usage:
censys tags operations cancel <tag> <operation-id> [flags]

Examples:
censys tags operations cancel my-tag <operation-id> # Stop a running bulk job

Flags:
-h, --help help for cancel
-o, --org-id string organization ID to target (personal access tokens only)

Global Flags:
--debug enable debug logging
--no-color disable ANSI colors and styles
--no-spinner disable spinner during operations
-O, --output-format string output format (json|yaml|tree|short|template) (default "short")
-q, --quiet suppress non-essential output
-S, --streaming enable streaming output mode (NDJSON) for commands that support it
--timeout-http duration per-request timeout for HTTP requests (e.g. 10s, 1m) - use 0 to disable

30 changes: 30 additions & 0 deletions cmd/cencli/e2e/fixtures/golden/tags_operations_get_help.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Retrieve a single bulk tag operation by the tag it belongs to, given by name or UUID, and
the operation's UUID.

Use --wait to poll until the operation finishes. Waiting exits non-zero if the operation
ends up failed or cancelled; without --wait the command simply reports the current status
and exits 0.

Usage:
censys tags operations get <tag> <operation-id> [flags]

Examples:
censys tags operations get my-tag <operation-id> # Show an operation's current status
censys tags operations get my-tag <operation-id> --wait # Poll until the operation finishes
censys tags operations get my-tag <operation-id> --wait --timeout 5m # Give up waiting after 5 minutes

Flags:
-h, --help help for get
-o, --org-id string organization ID to target (personal access tokens only)
--timeout string how long to wait before giving up (requires --wait) - use 0 for no limit (default "30m0s")
-w, --wait poll until the operation reaches a final status

Global Flags:
--debug enable debug logging
--no-color disable ANSI colors and styles
--no-spinner disable spinner during operations
-O, --output-format string output format (json|yaml|tree|short|template) (default "short")
-q, --quiet suppress non-essential output
-S, --streaming enable streaming output mode (NDJSON) for commands that support it
--timeout-http duration per-request timeout for HTTP requests (e.g. 10s, 1m) - use 0 to disable

26 changes: 26 additions & 0 deletions cmd/cencli/e2e/fixtures/golden/tags_operations_help.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Track the asynchronous jobs created by bulk tag operations.

Bulk assign and unassign submit a job rather than acting immediately; these commands list
those jobs, inspect a single one, and cancel one that is still running.

Usage:
censys tags operations [flags]
censys tags operations [command]

Available Commands:
cancel Cancel a running bulk tag operation
get Retrieve a single bulk tag operation
list List bulk tag operations

Flags:
-h, --help help for operations

Global Flags:
--debug enable debug logging
--no-color disable ANSI colors and styles
--no-spinner disable spinner during operations
-O, --output-format string output format (json|yaml|tree|short|template) (default "short")
-q, --quiet suppress non-essential output
-S, --streaming enable streaming output mode (NDJSON) for commands that support it
--timeout-http duration per-request timeout for HTTP requests (e.g. 10s, 1m) - use 0 to disable

Loading
Loading