CheatSheet
CheatSheet is a catalog of copy-and-paste commands for talking to common network services such as SSH, HTTP, HTTPS, and Telnet. You can open it from any open port on an asset, with the asset's address already filled in, or browse the whole catalog from the top navigation bar. CheatSheet only displays and copies text. Hawkra never runs the commands, and it is available to every user on every plan.
Connect from a port
On an asset's Ports table, each row has a Connect button in the Actions column. Like the other row actions, it is shown to workspace owners and editors on active workspaces.
- Click Connect on a port row.
- If the asset has both an IP address and a hostname, choose which one
{host}uses with the IP / Hostname toggle. IP is the default. - Review the commands. Each service that matches the port gets its own section, with a description above each command.
- Click Copy next to the command you want, then paste it into your terminal.
- Click Open in CheatSheet to jump to that service on the CheatSheet page.
The button is greyed out, with the tooltip "No connection commands for this service", when no catalog service matches the port. A port is matched on its detected service name only (for example ssh or http). The port number is never used, so a port with no detected service name has no commands.
The CheatSheet page
Click CheatSheet in the top navigation bar to browse the whole catalog.
- Search bar -- Filters the service list by service name or default port.
- Service list -- Each service with its default port. Select one to see its commands.
- Target host and Port fields -- Type an address to fill the
{host},{ip}, and{hostname}placeholders live. The port is prefilled with the service's default port and can be edited. - Copy -- Copies a single command with your values substituted.
If the catalog is empty, the page says so instead of showing a blank pane.
Placeholders
Command templates can contain these placeholders. They are replaced when the command is displayed.
| Placeholder | Replaced with |
|---|---|
{host} | The address you chose: the asset's IP or hostname in the Connect popup, or the Target host field on the CheatSheet page |
{ip} | The asset's IP address (the Target host value on the CheatSheet page) |
{hostname} | The asset's hostname (the Target host value on the CheatSheet page) |
{port} | The port number, or the editable port field on the CheatSheet page |
Values are made safe for a shell before they are inserted. A plain IP address or hostname is inserted as-is. Anything else is wrapped in single quotes so it cannot run a second command. Some values are deliberately left unsubstituted, and the placeholder stays visible in the command:
- A value that starts with
-, because a leading dash would be read as a command option. - A value that contains control characters such as a newline.
- Any placeholder written inside quotes in the template, such as
"http://{host}/". Templates should keep placeholders unquoted. - Every placeholder that comes after a heredoc (
<<), a backtick, ANSI-C quoting ($'...'), or$(inside double quotes. Quoting cannot protect a value in those forms, so substitution stops for the rest of the command.
A placeholder with no value, such as {hostname} on an asset with no hostname, becomes empty. Unknown placeholders are left as written.
Managing the catalog (admins)
Admins edit the catalog under Admin, then CheatSheet in the sidebar. There is one catalog for the whole instance, and changes appear in the Connect popup and on the CheatSheet page for other users after a page reload or within a few minutes.
Services
Click Add service, or edit an existing one. A service has:
| Field | Description |
|---|---|
| Name | Shown in the service list and as the Connect popup section heading (up to 100 characters) |
| Default port | 1 to 65535. Shown next to the name and prefilled as {port} on the CheatSheet page |
| Match patterns | Comma-separated patterns matched against a port's service name |
| Sort order | Lower numbers appear first |
Match patterns are case-insensitive and must match the whole service name. * matches any run of characters and ? matches one character. A service matches a port if any of its patterns matches.
| Pattern | Matches | Does not match |
|---|---|---|
ssh | ssh | openssh |
*ssh* | ssh, OpenSSH | http |
http,http-* | http, http-proxy | https |
Deleting a service also deletes its commands, after a confirmation.
Commands
Each service has an ordered list of commands. A command has a Description (up to 200 characters), the command template (up to 2000 characters) using the placeholders above, and a Sort order. Surrounding whitespace is trimmed from names, patterns, and descriptions, and leading and trailing newlines are stripped from commands. Everything inside a command is kept as you typed it.
Never put a placeholder anywhere the shell parses a second time: inside a heredoc, inside a string nested in backticks or $(...), in the remote command of ssh host '<remote command>' or in unquoted trailing ssh arguments (ssh host cmd {host}), which the remote shell also re-parses, or in an argument to sh -c, eval, or xargs. Quoting only protects the first parse, so a hostile target value could run commands on the second one. CheatSheet leaves placeholders unfilled when it detects the common forms (heredocs, backticks, $'...', $( inside double quotes, and # comments), but it cannot detect every case, such as ssh remote commands or sh -c.
Export and import
- Export downloads the whole catalog as
hawkra-cheatsheet.json. - Import takes a catalog file in the same format and asks how to apply it:
- Add to existing (default) adds every service in the file as a new entry. Duplicates are yours to clean up.
- Replace everything deletes every current service and command, then loads the file.
Replace everything permanently deletes the current catalog. Export a copy first if you may want it back. An import is all-or-nothing: if any entry in the file is invalid, nothing is changed. Files are limited to 1 MiB, 500 services, and 5000 commands.
Default services
A fresh Hawkra instance starts with four services, loaded once on first startup:
| Service | Default port | Match patterns |
|---|---|---|
| SSH | 22 | ssh,*openssh* |
| HTTP | 80 | http,http-* |
| HTTPS | 443 | https,https-*,ssl/http* |
| Telnet | 23 | telnet |
Because the defaults are loaded only once, anything an admin deletes stays deleted, and later upgrades never add entries back. To pick up new entries on an existing instance, use Import.