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

CommandWhat it doesNeeds an environment
swell auth loginStore an auth token for later commandsno
swell auth logoutRemove the stored credentialsno
swell completionPrint a bash completion scriptno
swell configPrint the configuration in forceno
swell foundation getenvsList the environments you can reachno
swell foundation getmatchesList each rule and the files it matchedyes
swell foundation getorgsList the organizations you can reachno
swell foundation mkassetCreate an assetyes
swell foundation mkenvCreate an environmentno
swell objects downloadDownload files by hashno
swell objects filter createCreate an intake filteryes
swell objects filter deleteDelete an intake filteryes
swell objects filter listList intake filtersyes
swell objects uploadSend files to Stairwell, attributed to an assetno
swell onboardCreate an asset for this machine and record its IDyes
swell query assetsQuery assetsyes
swell query filesQuery filesyes
swell query hostnamesQuery hostnamesyes
swell query ipsQuery IP addressesyes
swell query rulesQuery YARA rulesyes
swell tags createPut a tag on an asset, a file, or a ruleyes
swell tags deleteRemove a tagyes
swell tags listList the tags on one entitysometimes
swell verify compatibilityReport local software that may interfereno
swell verify connectivityProbe Stairwell's endpoints from this machineno
swell versionPrint the version of swell you are runningno
swell yara deleteDelete a ruleyes
swell yara downloadWrite every rule in an environment to diskyes
swell yara listList the rules in an environmentyes
swell yara uploadCreate or replace rules from filesyes

"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.

FlagTypeDefaultWhat it does
--auth_tokenstringfrom stored credentialsToken to authenticate with
--config_filestring~/.config/swell/swell.yamlConfig file to read
--environment_idstringnoneEnvironment to act in
--foundation_frontend_addressstringapi.app.stairwell.com:443API endpoint
--grpc_intake_server_addressstringgrpc.intake.app.stairwell.com:443Intake endpoint used by object filters
--insecureboolfalseSkip certificate and hostname verification
--intake_server_addressstringhttps://http.intake.app.stairwell.com:443Intake endpoint used by uploads
--organization_idstringfrom stored credentialsOrganization to act in
--parallel, -pintone per available CPUHow many transfers run at once
--plaintextboolfalseConnect without TLS

auth

Manages the stored credentials in ~/.config/swell/credentials.yaml.

CommandArgumentsFlags
swell auth loginnonenone beyond the global flags
swell auth logoutnonenone 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

CommandArgumentsFlags
swell completionnonenone 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

CommandArgumentsFlags
swell confignone--type
FlagTypeDefaultWhat it does
--typestringyamlFormat 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.

CommandArgumentsFlags
swell foundation getenvsnonenone beyond the global flags
swell foundation getmatchesnonenone beyond the global flags
swell foundation getorgsnonenone beyond the global flags
swell foundation mkassetone asset namenone beyond the global flags
swell foundation mkenvone environment namenone beyond the global flags

What each returns:

CommandColumns
getenvsEnvironment name, environment ID, default asset ID, creation time, sorted by name
getmatchesRule name, current version, whether the rule is active, number of matches, and the SHA256 of every matching file
getorgsOrganization ID, name, type, parent, domains, whether it has child organizations, default environments
mkassetThe name and ID of the asset created
mkenvThe 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

CommandArgumentsFlags
swell objects uploadone or more paths--asset, --attempts, --file, --format, --max_size, --password, --store_filename, --timeout
swell objects downloadone or more SHA256 hashes--file, --target_directory

objects upload

FlagTypeDefaultWhat it does
--assetstringfrom asset_id in the config fileID of the asset to attribute the uploaded files to
--attemptsint2How many times to try each file before giving up on it
--file, -fstringnonePath to a file listing paths to upload, one per line
--formatstringrawFormat of the files being uploaded: raw, zip, gzip, or 7z
--max_sizeint134217728Skip files larger than this many bytes. -1 means no limit
--passwordstringnonePassword for encrypted archives
--store_filenamebooltrueRecord the file's own path and name in Stairwell
--timeoutduration10mPer-file timeout. Zero or less means no timeout

Notes:

  • --asset takes an asset ID, not an asset name. If you leave it off, upload uses the asset_id that swell onboard wrote to your config file, so onboarding once is enough to start uploading. Get an ID from swell onboard, swell foundation mkasset, or the default asset ID in swell 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.
  • --parallel controls 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 --format to match what you are sending. With zip, gzip, or 7z, Stairwell unpacks the archive and the files inside it appear in your environment as their own objects. With raw, the archive itself is the object.
  • --store_filename=false sends 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

FlagTypeDefaultWhat it does
--file, -fstringnonePath to a file listing hashes to download, one per line
--target_directory, -tstringthe current directoryWhere 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.

CommandArgumentsFlags
swell objects filter listnonenone beyond the global flags
swell objects filter createa name and an expressionnone beyond the global flags
swell objects filter deleteone namenone 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:

VariableFields
assetid, the ID of the asset the file came from
objectpath, 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

CommandArgumentsFlags
swell onboardone asset namenone 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.

CommandArgumentsFlags
swell query assetsan optional query--json
swell query filesan optional query--json
swell query hostnamesan optional query--json
swell query ipsan optional query--json
swell query rulesan optional query--json
FlagTypeDefaultWhat it does
--jsonboolfalsePrint results as JSON instead of a table
CommandColumns
assetsID, name, creation time
filesSHA256, MD5, SHA1, size
hostnamesHostname
ipsIP address
rulesName, 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. query scopes to the single environment in --environment_id.
  • assets, files, and rules take 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.
  • --json emits 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.

CommandArgumentsFlags
swell tags createnone--key, --value, plus one entity flag
swell tags deletenone--key, --value, plus one entity flag
swell tags listnoneone entity flag
FlagTypeWhat it does
--keystringKey of the tag
--valuestringValue of the tag. Required, and it cannot be empty

Entity flags. Exactly one entity has to be identified, and identifying two is an error:

FlagTypeIdentifies
--asset.idstringAn asset, by ID
--object.idintA file, by its numeric ID
--object.md5stringA file, by MD5
--object.sha1stringA file, by SHA1
--object.sha256stringA file, by SHA256
--rule.namestringA YARA rule, by name
--rule.versionintWhich version of that rule
--rule.environment_idstringWhich 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.

CommandArgumentsFlags
swell verify connectivitynone--asset_id
swell verify compatibilitynone--output
FlagTypeDefaultWhat it does
--asset_idstringnoneAlso upload a one megabyte random file to this asset, to test the whole ingest path
--outputstringnoneAlso 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

CommandArgumentsFlags
swell yara listnone--json
swell yara uploadone or more paths--attempts, --file, --recursive, --replace_existing_rules
swell yara downloadnone--force, --target_directory
swell yara deletenone--rule_name, --rule_version

yara list

FlagTypeDefaultWhat it does
--jsonboolfalsePrint 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

FlagTypeDefaultWhat it does
--attemptsint5How many times to retry a rule when the server is briefly unavailable
--file, -fstringnonePath to a file listing paths to upload, one per line
--recursive, -rboolfalseDescend into subdirectories
--replace_existing_rulesboolfalseReplace 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_rules is 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 --parallel says, 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

FlagTypeDefaultWhat it does
--force, -fboolfalseOverwrite files that already exist
--target_directory, -tstringthe current directoryWhere 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

FlagTypeDefaultWhat it does
--rule_namestringnoneName of the rule to delete
--rule_versionint0Version 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

CommandArgumentsFlags
swell versionnonenone 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?


Did this page help you?