swell Command Reference
Every swell command group, every subcommand, and every flag, with defaults and which ones require an environment. The page to open mid-command.
This page lists every swell command and the flags it accepts. It is a lookup page. If you are setting swell up for the first time, read swell and swell Configuration first, and come back here for the flag you cannot remember.
Two conventions hold throughout. Commands are noun then verb, so it is swell objects upload, not swell upload objects. Flag names are snake_case, so it is --environment_id, never --environmentId or --environment-id. And every command, at every level, takes --help.
Every command
| Command | What it does | Needs an environment |
|---|---|---|
swell auth login | Store an auth token for later commands | no |
swell auth logout | Remove the stored credentials | no |
swell completion | Print a bash completion script | no |
swell config | Print the configuration in force | no |
swell foundation getenvs | List the environments you can reach | no |
swell foundation getmatches | List each rule and the files it matched | yes |
swell foundation getorgs | List the organizations you can reach | no |
swell foundation mkasset | Create an asset | yes |
swell foundation mkenv | Create an environment | no |
swell objects download | Download files by hash | no |
swell objects filter create | Create an intake filter | yes |
swell objects filter delete | Delete an intake filter | yes |
swell objects filter list | List intake filters | yes |
swell objects upload | Send files to Stairwell, attributed to an asset | no |
swell onboard | Create an asset for this machine and record its ID | yes |
swell query assets | Query assets | yes |
swell query files | Query files | yes |
swell query hostnames | Query hostnames | yes |
swell query ips | Query IP addresses | yes |
swell query rules | Query YARA rules | yes |
swell tags create | Put a tag on an asset, a file, or a rule | yes |
swell tags delete | Remove a tag | yes |
swell tags list | List the tags on one entity | sometimes |
swell verify compatibility | Report local software that may interfere | no |
swell verify connectivity | Probe Stairwell's endpoints from this machine | no |
swell version | Print the version of swell you are running | no |
swell yara delete | Delete a rule | yes |
swell yara download | Write every rule in an environment to disk | yes |
swell yara list | List the rules in an environment | yes |
swell yara upload | Create or replace rules from files | yes |
"Needs an environment" means the command fails without --environment_id, or the equivalent environment variable or config file entry. swell verify needs neither an environment nor credentials, which is what makes it usable on a host that has never talked to Stairwell.
Global flags
Available on every command. Each one can also be set by environment variable or config file; swell Configuration covers the naming and the precedence.
| Flag | Type | Default | What it does |
|---|---|---|---|
--auth_token | string | from stored credentials | Token to authenticate with |
--config_file | string | ~/.config/swell/swell.yaml | Config file to read |
--environment_id | string | none | Environment to act in |
--foundation_frontend_address | string | api.app.stairwell.com:443 | API endpoint |
--grpc_intake_server_address | string | grpc.intake.app.stairwell.com:443 | Intake endpoint used by object filters |
--insecure | bool | false | Skip certificate and hostname verification |
--intake_server_address | string | https://http.intake.app.stairwell.com:443 | Intake endpoint used by uploads |
--organization_id | string | from stored credentials | Organization to act in |
--parallel, -p | int | one per available CPU | How many transfers run at once |
--plaintext | bool | false | Connect without TLS |
auth
Manages the stored credentials in ~/.config/swell/credentials.yaml.
| Command | Arguments | Flags |
|---|---|---|
swell auth login | none | none beyond the global flags |
swell auth logout | none | none beyond the global flags |
login prints a URL, waits for you to paste back the token Stairwell shows you in the browser, then looks up and stores your user and organization alongside it. logout clears all three.
completion
| Command | Arguments | Flags |
|---|---|---|
swell completion | none | none beyond the global flags |
Prints a bash completion script to standard output. Source it into the current shell, or add the same line to your shell startup file to get completion in every session.
config
| Command | Arguments | Flags |
|---|---|---|
swell config | none | --type |
| Flag | Type | Default | What it does |
|---|---|---|---|
--type | string | yaml | Format to print the configuration in |
Prints the configuration in force after flags, environment variables, the config file, and defaults have been resolved. It includes your auth token in the clear.
foundation
Creates and lists the things an environment is made of.
| Command | Arguments | Flags |
|---|---|---|
swell foundation getenvs | none | none beyond the global flags |
swell foundation getmatches | none | none beyond the global flags |
swell foundation getorgs | none | none beyond the global flags |
swell foundation mkasset | one asset name | none beyond the global flags |
swell foundation mkenv | one environment name | none beyond the global flags |
What each returns:
| Command | Columns |
|---|---|
getenvs | Environment name, environment ID, default asset ID, creation time, sorted by name |
getmatches | Rule name, current version, whether the rule is active, number of matches, and the SHA256 of every matching file |
getorgs | Organization ID, name, type, parent, domains, whether it has child organizations, default environments |
mkasset | The name and ID of the asset created |
mkenv | The environment created |
getenvs is the command to reach for first on a new machine: it is the shortest path to the environment ID every other command wants.
getmatches walks every rule in the environment and pages through all matches for each one, so it is slow and returns a lot on an environment with many rules. For a rule you already have in mind, swell query files with a rule condition is faster, and Manage YARA Rules covers the same ground in the app.
objects
| Command | Arguments | Flags |
|---|---|---|
swell objects upload | one or more paths | --asset, --attempts, --file, --format, --max_size, --password, --store_filename, --timeout |
swell objects download | one or more SHA256 hashes | --file, --target_directory |
objects upload
| Flag | Type | Default | What it does |
|---|---|---|---|
--asset | string | from asset_id in the config file | ID of the asset to attribute the uploaded files to |
--attempts | int | 2 | How many times to try each file before giving up on it |
--file, -f | string | none | Path to a file listing paths to upload, one per line |
--format | string | raw | Format of the files being uploaded: raw, zip, gzip, or 7z |
--max_size | int | 134217728 | Skip files larger than this many bytes. -1 means no limit |
--password | string | none | Password for encrypted archives |
--store_filename | bool | true | Record the file's own path and name in Stairwell |
--timeout | duration | 10m | Per-file timeout. Zero or less means no timeout |
Notes:
--assettakes an asset ID, not an asset name. If you leave it off, upload uses theasset_idthatswell onboardwrote to your config file, so onboarding once is enough to start uploading. Get an ID fromswell onboard,swell foundation mkasset, or the default asset ID inswell foundation getenvs.- Directories are walked recursively. Passing a directory sends everything under it that passes the size limit, which is how a one-off sweep of an appliance is done.
--parallelcontrols how many files are in flight, defaulting to one worker per available CPU. Lower it on a production host you do not want to load.- Set
--formatto match what you are sending. Withzip,gzip, or7z, Stairwell unpacks the archive and the files inside it appear in your environment as their own objects. Withraw, the archive itself is the object. --store_filename=falsesends the file content without its name or path. Use it when the path itself is sensitive. You give up searching on filename for those uploads.- The command exits non-zero and names every path it could not upload, so a scheduled job can be gated on it.
objects download
| Flag | Type | Default | What it does |
|---|---|---|---|
--file, -f | string | none | Path to a file listing hashes to download, one per line |
--target_directory, -t | string | the current directory | Where to write the files |
Each file is written under a filename equal to its SHA256. The command refuses rather than overwrite a file that is already there, and it does not create the target directory for you. Downloaded files are the real thing: write them somewhere your own endpoint protection will not act on them.
objects filter
Intake filters drop files as they arrive, at the point of ingest, before anything is stored. Filters are per environment and each one has a name that has to be unique within the environment.
| Command | Arguments | Flags |
|---|---|---|
swell objects filter list | none | none beyond the global flags |
swell objects filter create | a name and an expression | none beyond the global flags |
swell objects filter delete | one name | none beyond the global flags |
Read the direction carefully, because it is the opposite of a search filter: a filter that evaluates to true drops the file. An environment can hold several filters, and a file is dropped if any one of them matches.
The expression is written in CEL and has to resolve to a boolean. Two variables are available:
| Variable | Fields |
|---|---|
asset | id, the ID of the asset the file came from |
object | path, the file's path, and name, its filename |
Quote the expression, because it will contain characters your shell wants to interpret.
list prints one row per filter with its name and its expression, which is the fastest way to see what an environment is currently dropping. There is no update verb, so to change a filter, create the replacement and then delete the old one, in that order, so there is no window where neither is in place.
onboard
| Command | Arguments | Flags |
|---|---|---|
swell onboard | one asset name | none beyond the global flags |
Creates an asset in the environment you named and prints its ID, then writes the configuration in force back out to ~/.config/swell/swell.yaml, including the new asset ID.
Two consequences. Run onboard before you hand-edit that config file, not after. And swell objects upload picks that asset up automatically, so you do not need to pass --asset again unless you want a different one.
The name is for you: it is what the machine is called in the Assets view. The ID is what commands take.
query
Runs the same queries as the search box in the app and prints results as a table, or as JSON for a script to read.
| Command | Arguments | Flags |
|---|---|---|
swell query assets | an optional query | --json |
swell query files | an optional query | --json |
swell query hostnames | an optional query | --json |
swell query ips | an optional query | --json |
swell query rules | an optional query | --json |
| Flag | Type | Default | What it does |
|---|---|---|---|
--json | bool | false | Print results as JSON instead of a table |
| Command | Columns |
|---|---|
assets | ID, name, creation time |
files | SHA256, MD5, SHA1, size |
hostnames | Hostname |
ips | IP address |
rules | Name, status, update time, version, sorted by name |
Notes:
- The query argument is CEL, the same language the app's filter boxes take. Quote it. Omitting it returns everything in the environment, subject to one page of results.
- One environment at a time.
queryscopes to the single environment in--environment_id. assets,files, andrulestake a--timeout, defaulting to two minutes. A broad query against a large environment can still exceed it, and the error says so and names the flag. Raise it for a deliberately wide sweep, or run the query in the app, where Hunting and Search covers the wider surface.--jsonemits a single array, which is the form to read from a script.
tags
A tag is a key and a value attached to one asset, one file, or one YARA rule. Tags are per environment.
| Command | Arguments | Flags |
|---|---|---|
swell tags create | none | --key, --value, plus one entity flag |
swell tags delete | none | --key, --value, plus one entity flag |
swell tags list | none | one entity flag |
| Flag | Type | What it does |
|---|---|---|
--key | string | Key of the tag |
--value | string | Value of the tag. Required, and it cannot be empty |
Entity flags. Exactly one entity has to be identified, and identifying two is an error:
| Flag | Type | Identifies |
|---|---|---|
--asset.id | string | An asset, by ID |
--object.id | int | A file, by its numeric ID |
--object.md5 | string | A file, by MD5 |
--object.sha1 | string | A file, by SHA1 |
--object.sha256 | string | A file, by SHA256 |
--rule.name | string | A YARA rule, by name |
--rule.version | int | Which version of that rule |
--rule.environment_id | string | Which environment the rule is in. Falls back to --environment_id |
--rule.version and --rule.environment_id only mean anything alongside --rule.name, and --rule.name is the one case where swell tags list needs an environment: it uses --environment_id when --rule.environment_id is not given.
tags list reports every tag on the entity across all the environments you can reach, and prints the environment each tag came from. That is deliberate: the same file can carry different tags in different environments, and knowing which environment a tag came from is usually the point of asking.
verify
Diagnostics you run before deploying. Neither subcommand needs credentials or an environment. Pre-Deployment Check covers how to read the output and what to do when a probe fails.
| Command | Arguments | Flags |
|---|---|---|
swell verify connectivity | none | --asset_id |
swell verify compatibility | none | --output |
| Flag | Type | Default | What it does |
|---|---|---|---|
--asset_id | string | none | Also upload a one megabyte random file to this asset, to test the whole ingest path |
--output | string | none | Also write the compatibility report to this file |
connectivity probes four endpoints from the machine you run it on: the web app, the API, HTTP intake, and gRPC intake. Each probe gets ten seconds. An HTTP error response still counts as reachable, because the probe tests the path and not your credentials; what fails a probe is a network or TLS error. A failure on either gRPC row is reported as a warning and does not change the exit code. Any other failure makes the command exit non-zero, so it works as a gate in whatever tooling pushes your installs.
compatibility reports what is on the host that commonly needs an exclusion: endpoint protection and proxy clients it recognizes, the state of the host firewall, and any proxy environment variables that are set. It makes no network calls and sends nothing to Stairwell.
yara
| Command | Arguments | Flags |
|---|---|---|
swell yara list | none | --json |
swell yara upload | one or more paths | --attempts, --file, --recursive, --replace_existing_rules |
swell yara download | none | --force, --target_directory |
swell yara delete | none | --rule_name, --rule_version |
yara list
| Flag | Type | Default | What it does |
|---|---|---|---|
--json | bool | false | Print results as JSON instead of a table |
Prints every rule at its current version, with the rule name, that version, and whether the rule is active, sorted by name. It pages through the whole environment rather than returning one page.
yara upload
| Flag | Type | Default | What it does |
|---|---|---|---|
--attempts | int | 5 | How many times to retry a rule when the server is briefly unavailable |
--file, -f | string | none | Path to a file listing paths to upload, one per line |
--recursive, -r | bool | false | Descend into subdirectories |
--replace_existing_rules | bool | false | Replace the current version of a rule of the same name instead of failing |
Notes:
- A file can hold many rules and each one is uploaded separately. The output names the file and the rule for every success and every failure, so a partial result is legible.
- Without
--recursive, subdirectories are skipped and named on standard error rather than silently ignored. The directory you pass on the command line is always read. --replace_existing_rulesis what you want in a pipeline. Without it, a rule whose name already exists in the environment is a failure, so re-running the same push fails the second time.- Private and global rules are skipped, with a line on standard error naming each one. Split them out if you were relying on them.
- Rule uploads are capped at sixteen at a time, whatever
--parallelsays, to stay inside the server's rate limits.
Rules pushed this way behave exactly like rules written in the app, so Writing Your First YARA Rule and YARA Rule Best Practices apply unchanged.
yara download
| Flag | Type | Default | What it does |
|---|---|---|---|
--force, -f | bool | false | Overwrite files that already exist |
--target_directory, -t | string | the current directory | Where to write the rules |
Writes every rule in the environment to its own file, named for the rule with a .yara extension. Without --force, the command stops at the first file that already exists, so a re-run into the same directory does nothing until you either clear it or pass the flag.
Watch the short form here. On yara download, -f is --force. On yara upload and objects upload, -f is --file. Spell both out in a script.
yara delete
| Flag | Type | Default | What it does |
|---|---|---|---|
--rule_name | string | none | Name of the rule to delete |
--rule_version | int | 0 | Version to delete. It has to be the current version |
Deletion is per version, and only the current version can be deleted. Read the version out of swell yara list immediately before you delete rather than from a value you cached earlier.
version
| Command | Arguments | Flags |
|---|---|---|
swell version | none | none beyond the global flags |
Prints the version of swell you are running. Quote it in any support request, because it is the first thing that explains behavior not matching this page.
What should I read next?
- swell Configuration, for precedence, the config file, and multiple deployments.
- Pre-Deployment Check, for the checks that go before a forwarder rollout.
- CEL Query Language, for the syntax
swell queryand intake filters take.
Updated 4 days ago