Skip to content

login

Sign in to Archidekt so syncs and imports can use your account, check the stored login, or clear it.

Terminal window
ritual login archidekt [options]
ritual login status [--output <format>]
ritual login logout [--output <format>] [--quiet]
Subcommand Description
archidekt Login to Archidekt for private deck access
status Show the stored login and whether its session is still usable
logout Clear the stored Archidekt login token

Prompts for a username and password on a terminal. When a valid session already exists, the command reports it and exits without prompting. Use --force-login to log in again anyway.

Option Description Default
-f, --force-login Force a new login even if a session exists false
--username <username> Archidekt username or email (for scripting)
--password-stdin Read the password from stdin (for scripting) false

For scripts and agents, pass --username together with --password-stdin and pipe the password on stdin. No prompts are shown, and explicit credentials always perform a fresh login:

Terminal window
printf '%s' "$ARCHIDEKT_PASSWORD" | ritual login archidekt --username myuser --password-stdin

Passing only one of the two flags is a usage error (exit code 2), as is an empty password on stdin. When prompts are disabled (--no-input, RITUAL_NO_INPUT, or stdin is not a terminal) and no credential flags are given, the command fails with a usage error pointing at --username/--password-stdin instead of hanging.

Code Meaning
0 Logged in (or a valid session already existed)
1 The login itself failed (bad credentials, network error)
2 Usage error: cancelled prompts, missing/partial credential flags, empty password

Reports whether an Archidekt login is stored, for which user, and whether the next sync can authenticate with it. It never touches the network; validity comes from the stored tokens’ own exp claims.

An expired access token is not a problem on its own; it is refreshed automatically on the next request. Only when the refresh token has also expired does the session need a fresh login archidekt. That is what loginRequired reports.

Terminal window
ritual login status
# Logged in to Archidekt as myuser (session valid until 2026-08-03T00:00:00.000Z)
Stored login Text line
Access token valid Logged in to Archidekt as myuser (session valid until <ISO>)
Access expired, refresh OK Logged in to Archidekt as myuser (access token expired; it refreshes on the next request)
Both expired Logged in to Archidekt as myuser (session expired — run "ritual login archidekt")
Stored, but naming no account Logged in to Archidekt (the stored login does not name an account)
None Not logged in.
Terminal window
ritual login status --output json
{
"loggedIn": true,
"username": "myuser",
"accessTokenExpiration": "2026-08-03T00:00:00.000Z",
"accessTokenValid": true,
"refreshTokenExpiration": "2026-09-01T00:00:00.000Z",
"refreshTokenValid": true,
"loginRequired": false
}

The admin API serves the same payload at GET /api/login/archidekt, and the MCP get_sync_status tool carries it as its archidekt section.

The status line is the command’s entire payload, so status has no --quiet (shared convention). To branch purely on the exit code, redirect stdout:

Terminal window
ritual login status > /dev/null && echo "ready to sync" || echo "sign in first"
Code Meaning
0 A stored login whose session can still authenticate (loginRequired: false)
1 A stored login whose tokens have all expired — run ritual login archidekt
3 No stored Archidekt login

Deletes the stored Archidekt token file. It reports the username that was logged out, or that there was nothing to clear. Both cases exit 0. It takes the same --output flag as status, plus --quiet, which drops the text confirmation while still emitting the structured payload under --output json/ndjson.

Terminal window
ritual login logout
# Logged out of Archidekt (was myuser). Stored token cleared.
ritual login logout --output json
{
"loggedOut": true,
"username": "myuser"
}

With nothing stored the payload is { "loggedOut": false }.

Authentication tokens are stored locally in the .logins/ directory and used automatically for later requests.