Concourse Shell#
The Concourse Shell (CaSH) is a built-in interactive interface for working with Concourse. CaSH supports two input modes — CCL commands and Groovy scripting — and includes features like tab completion, syntax highlighting, prepare mode, and persistent history.
Starting CaSH#
Warning
Make sure that Concourse is running before starting CaSH.
1 | |
Connection Parameters#
Specify connection options to connect to a different server, port, or environment:
1 2 | |
| Option | Description | Default |
|---|---|---|
-h, --host |
Server hostname | localhost |
-p, --port |
Server port | 1717 |
-e, --environment |
Environment name | (default) |
-u, --username |
Username | admin |
--password |
Password (prompts if omitted) | |
--prefs, --config |
Path to client config file |
Non-Interactive Mode#
Run a single command and exit:
1 | |
Dual-Mode Input#
CaSH accepts input in two modes. It tries the CCL command parser first, and falls back to Groovy if that fails.
CCL Commands#
Use natural, SQL-like syntax for common operations:
1 2 3 4 | |
Groovy Mode#
For complex logic or operations not covered by CCL syntax, use
the full Groovy scripting language. The concourse variable
provides access to the complete Concourse API:
1 2 3 4 | |
Combined Error Reporting#
If input fails both modes, CaSH reports errors from both parsers to help you diagnose the issue.
Tab Completion#
CaSH provides context-aware tab completion. Press Tab to cycle
through completions for:
- Command verbs:
select,find,add,get, etc. - Key names: Loaded from the server asynchronously
- Operators:
=,>,<,contains, etc. - Colon commands:
:help,:prepare, etc. - Method names: Concourse API methods and their signatures
Completions are grouped by category and include signature hints to guide parameter entry.
Refreshing Completion Data#
Completion metadata is loaded from the server at startup. To reload it after schema changes:
1 | |
Syntax Highlighting#
CaSH highlights input in real time:
- Command verbs in green
- Colon commands in cyan
- Groovy keywords in blue
- Strings in yellow
- Numbers in magenta
- Comments in gray
Colon Commands#
CaSH provides built-in commands prefixed with : that control
shell behavior.
| Command | Description |
|---|---|
:help [command] |
Display help, optionally for a specific command |
:prepare |
Enter prepare mode |
:submit |
Submit all prepared commands |
:discard |
Discard prepared commands |
:stage |
Begin a transaction |
:commit |
Commit the active transaction |
:abort |
Abort the active transaction |
:reconnect |
Re-establish connection to the server |
:refresh |
Reload completion metadata from the server |
:history |
Display command history |
:load <path> |
Load and execute a script file |
:show records |
Display total record count |
:exit |
Exit CaSH |
Prepare Mode#
Prepare mode lets you queue multiple commands and submit them as a batch. This is useful for building up a sequence of operations (including transactions) before executing them.
Enter Prepare Mode#
1 | |
The prompt changes to indicate prepare mode and shows the number of queued commands:
1 | |
Queue Commands#
Type commands as usual. Instead of executing immediately, they are queued:
1 2 3 4 | |
Submit or Discard#
Submit all queued commands:
1 | |
Or discard them:
1 | |
Transaction Validation#
CaSH validates transaction semantics as you queue commands. It warns you about issues like:
commitwithout a precedingstage- Nested
stagecalls - Unmatched
abort
Run Commands File#
CaSH automatically loads and executes a .cashrc file from
your home directory at startup. This seeds each session with
common configuration, custom functions, and variables.
Custom Run Commands File#
1 | |
Disable Run Commands#
1 | |
Custom Functions#
Define reusable functions in .cashrc using Groovy syntax:
1 2 3 4 5 6 7 8 9 10 | |
Then invoke them in any session:
1 2 | |
Custom Variables#
Define variables that are available throughout the session:
1 2 | |
Built-in Functions#
CaSH provides several built-in utility functions:
time()#
Return the current timestamp or parse a natural language time description:
1 2 3 | |
show()#
Display information about records:
1 | |
History#
CaSH maintains a persistent command history in ~/.cash_history.
History survives across sessions.
View History#
1 | |
Navigate History#
Use the up and down arrow keys to scroll through previous commands.
Automatic Paging#
When output exceeds the terminal height, CaSH automatically
pipes it through a pager (less) for comfortable reading. The
pager exits when you press q, and the output remains visible
in the terminal scrollback.
Reconnecting#
If the connection to the server is lost, use :reconnect to
re-establish it using the same credentials:
1 | |
CaSH also detects connection loss automatically and prompts you to reconnect.
Multi-Line Input#
CaSH supports multi-line input. Lines ending with an open parenthesis, bracket, brace, or escaped newline continue to the next line:
1 2 3 4 5 6 | |
The secondary prompt > indicates that CaSH is waiting for more
input.
Dynamic Prompt#
The CaSH prompt displays the current environment and mode:
1 2 3 | |