All apps/Cargo

Cargo

cargo

Rust's package manager and build tool.

Runs as cargo|macOS, Linux, Windows|doc.rust-lang.org

Command form

ai-draft · 7 tasks · 45 fields

Build, test, run and create Rust packages. Other cargo commands (publish, install, doc, clippy) are left out.

Opens the form; the finished command lands at your prompt, unrun
otty gui cargo

cargo build

Build a package

Compile a local package and its dependencies.

Build a packageExample values, fixed in this page — nothing here reaches a terminal
Basic
Release mode
--release
Package
string
Whole workspace
--workspace
TasksEach one presets the form for one job
Release build
releasepackageworkspace
Whole workspace
workspacerelease
ParametersOnly these flags are editable in the form
Release mode
Build artifacts in release mode, with optimizations.
boolean
--release-r
Package
Package to build.
string
--package-p
Features
Space or comma separated list of features to activate.
string
--features
All features
Activate all available features.
boolean
--all-features
No default features
Do not activate the default feature.
boolean
--no-default-features
Manifest path
Path to Cargo.toml.
path
--manifest-path
Locked
Require Cargo.lock is up to date.
boolean
--locked
Offline
Run without accessing the network.
boolean
--offline
Verbosity
Use verbose output (-vv very verbose).
count
--verbose-v
Whole workspace
Build all packages in the workspace.
boolean
--workspace
Library only
Build only this package's library.
boolean
--lib
Binary
Build only the specified binary.
string
--bin
Target triple
Build for the target triple.
string
--target

cargo test

Run tests

Execute unit and integration tests. Arguments after -- go to the test harness and are not covered.

Run testsExample values, fixed in this page — nothing here reaches a terminal
Basic
Whole workspace
--workspace
Keep going on failure
--no-fail-fast
TasksEach one presets the form for one job
Test the workspace
workspaceno_fail_fast
Run matching tests
testnamepackage
ParametersOnly these flags are editable in the form
Test name filter
Only run tests whose name contains this string.
string · positional 0
Release mode
Build artifacts in release mode, with optimizations.
boolean
--release-r
Package
Package to test.
string
--package-p
Features
Space or comma separated list of features to activate.
string
--features
All features
Activate all available features.
boolean
--all-features
No default features
Do not activate the default feature.
boolean
--no-default-features
Manifest path
Path to Cargo.toml.
path
--manifest-path
Locked
Require Cargo.lock is up to date.
boolean
--locked
Offline
Run without accessing the network.
boolean
--offline
Verbosity
Use verbose output (-vv very verbose).
count
--verbose-v
Whole workspace
Test all packages in the workspace.
boolean
--workspace
Library tests only
Test only this package's library unit tests.
boolean
--lib
Doc tests only
Test only this library's documentation.
boolean
--doc
Compile only
Compile, but don't run tests.
boolean
--no-run
Keep going on failure
Run all tests regardless of failure.
boolean
--no-fail-fast

cargo run

Run a binary

Build and run a binary or example. Program arguments after -- are not covered.

Run a binaryExample values, fixed in this page — nothing here reaches a terminal
Basic
Binary
string
Release mode
--release
TasksEach one presets the form for one job
Run in release mode
binrelease
ParametersOnly these flags are editable in the form
Binary
Name of the bin target to run.
string
--bin
Example
Name of the example target to run.
string
--example
Release mode
Build artifacts in release mode, with optimizations.
boolean
--release-r
Package
Package to run.
string
--package-p
Features
Space or comma separated list of features to activate.
string
--features
All features
Activate all available features.
boolean
--all-features
No default features
Do not activate the default feature.
boolean
--no-default-features
Manifest path
Path to Cargo.toml.
path
--manifest-path
Locked
Require Cargo.lock is up to date.
boolean
--locked
Offline
Run without accessing the network.
boolean
--offline
Verbosity
Use verbose output (-vv very verbose).
count
--verbose-v

cargo new

New package

Create a new cargo package in a new directory.

New packageExample values, fixed in this page — nothing here reaches a terminal
Basic
Directory*
directory
Library
--lib
Advanced
Edition
string
TasksEach one presets the form for one job
New library
pathlibedition
New binary
pathbinedition
ParametersOnly these flags are editable in the form
Directory
Directory to create.
path · positional 0
Library
Use a library template.
boolean
--lib
Binary
Use a binary (application) template (default).
boolean
--bin
Package name
Set the package name, defaults to the directory name.
string
--name
Edition
Edition to set for the crate generated.
string
--edition201520182021
Version control
Initialize a new repository for the given version control system.
string
--vcsgithgpijulfossilnone
SourcesEvery flag above is checked against these
fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

Before it fills your prompt, Otty checks the installed cargo against its version. A form that does not match your version is not offered.