Skip to main content

Command line

idk is the platform's command-line client. It signs in from a terminal, manages workspaces, volumes, clusters, templates and teams, connects to workspaces over SSH, copies files to and from them, and serves AI agents on your machine.

Install​

Each release attaches idk to its GitHub release for Linux, macOS and Windows on amd64 and arm64, as idk_<version>_<os>_<arch> (.exe on Windows), with their SHA-256 sums in checksums.txt. Rename yours to idk, make it executable and put it on your PATH. From a checkout, make cli builds it into bin/idk.

Sign in​

idk login https://idekube.example.org

idk prints a code and opens the platform's Authorize device page in your browser. Sign in there if you are not, check that the page shows the same code, and choose Authorize; the platform first asks you to confirm who you are. Deny refuses it. The code is valid for 10 minutes.

idk then holds an API token named after your machine, listed on the Developer tab of your profile like any other:

  • --scopes workspaces:write,volumes:read asks for a token limited to those scopes; without it, the token has full access.
  • --days sets how long it lasts, 90 days unless you say otherwise; 0 never expires.
  • --no-browser only prints the page's address, for a machine without a browser.
  • --token idk_… signs in with a token you made yourself. It is the only way when the platform asks for a challenge at every sign-in, which a terminal cannot answer.

Each installation you sign in to is a context, named after its host and kept in idekube/config.json in your user configuration directory (~/.config on Linux), or in the file IDEKUBE_CONFIG names. idk context ls lists the contexts and idk context use <name> switches between them. idk logout forgets the current one; its token works until you delete it, on the Developer tab or with idk token rm. The flags --url, --token, --context and --team, or IDEKUBE_URL, IDEKUBE_TOKEN, IDEKUBE_CONTEXT and IDEKUBE_TEAM, take the place of what the context holds, in a CI job for example.

idk whoami shows who you are signed in as, and the scopes of your token.

Naming things​

A command takes a workspace, volume, cluster or template by its name, its ID, or as team/name. A name alone is looked up in the default team, given by --team (-t) or IDEKUBE_TEAM, or saved with the context when you sign in with --team; without one, in all your teams, and in your personal team first when several have it. personal names your personal team.

Lists print a table; -o json and -o yaml print what the API answers, and -q only the IDs, for scripts. idk help lists the commands, and -h after one lists its flags.

Workspaces​

idk ws ls
idk ws create --template python --cpu 2000 --memory 4096 --wait thesis
idk ws stop thesis
idk ws open thesis

The flags of a command come before its arguments: idk ws create thesis --template python is refused. idk ws also edits, starts, restarts, deletes and waits for workspaces, and shows what one uses now (idk ws usage). idk vol, idk cluster, idk team and idk var manage volumes, clusters, teams and variables.

SSH​

When the workspace's template has an SSH endpoint at /ssh, idk connects to it through the platform, with no other tool than OpenSSH's ssh:

idk ssh thesis # a shell
idk ssh thesis -- nvidia-smi # one command
idk config-ssh # then ssh idekube.thesis, scp, rsync or VS Code's Remote-SSH

The workspace accepts the SSH keys of your profile. A stopped workspace is started first, unless you pass --no-autostart.

idk config-ssh adds to ~/.ssh/config, between # --- BEGIN IDEKUBE --- and # --- END IDEKUBE ---, a host idekube.<name> for each of your workspaces and idekube.* for the ones you make later, each with idk as its ProxyCommand. Running it again replaces that block; --remove takes it out, and --dry-run prints it instead.

idk port-forward thesis 8888:8888 (idk pf) forwards a local port to one in the workspace, and 8080:db:5432 to a host the workspace reaches, until you stop it. It signs in with the keys of your SSH agent and of ~/.ssh/id_ed25519, id_ecdsa and id_rsa, or of the file --identity names instead of those three.

Files​

idk ls thesis:/home/idekube
idk cp ./data.csv thesis:/home/idekube/
idk cp thesis:/home/idekube/results ./

These reach the volumes of a running workspace, as its files panel does: paths are absolute, and idk ls thesis lists the volumes. A folder downloads as a zip archive; an upload is one file. An existing file is replaced only with --overwrite. idk mkdir and idk rm-file make and delete folders and files. idk tasks thesis lists the workspace's tasks and their state, and idk tasks thesis <task> prints the output of one.

Templates​

idk template pull python python.yaml
idk template check python.yaml
idk template push --template python --submit python.yaml

check reports the problems the editor would. push saves the file as the template's next draft, or, without --template, as a new template of the default team or of your personal team; --submit submits it for review.

Administration​

idk admin reaches what administrators manage: workers, users, roles, settings, plugins, jobs, backups, the audit log and usage, each as far as the token's permissions go.