Skip to content
Logo

ATTIM CLI

The ATTIM CLI turns a folder, ./dist, or a single index.html into a live URL. It builds the file manifest, requests presigned upload targets, uploads files, and finalizes the version by default.

Install and run

Run without installing:

npx attim publish ./dist

Or install globally so attim is available as a bare command:

npm install -g attim
attim login
attim publish ./dist

For local development from this repo:

cd cli
npm test
node ./bin/attim.mjs --help

Authentication

Run attim login to authenticate with your ATTIM email code and store an account API token locally. The config file is stored at ~/.config/attim/config.json by default. Set ATTIM_CONFIG_DIR to override the config directory.

attim login
attim whoami
attim update my-site ./dist

If your account already has an active account API token, attim login automatically rotates it because ATTIM cannot reveal an existing raw token again. Use --token only when you already saved a token and want to store it locally without rotating:

attim login                   # create or rotate the account API token and store it locally
attim login --rotate          # explicit rotate; kept for scripted flows
attim login --token attim_uat_...  # store a token you already saved

attim logout removes the locally stored token only. It does not revoke the server-side account API token; revoke that from /access if needed.

Credential precedence for claimed-site commands is:

  1. --token <token>
  2. ATTIM_API_TOKEN
  3. token saved by attim login

Anonymous publish claim tokens returned by the CLI are saved locally and reused for update, finalize, delete, and claim. Use --claim-token or ATTIM_CLAIM_TOKEN when managing an anonymous site published elsewhere.

Claim locally saved anonymous sites after login:

attim claim my-site
attim claim --all

Publishing

attim publish ./dist
attim publish index.html
attim publish ./dist --slug my-site --token attim_uat_...
attim publish ./dist --password secret-password
attim publish ./dist --no-finalize
attim publish ./dist --dry-run
attim clone source-site --ttl 86400
attim fork source-site --slug my-copy --token attim_uat_...

publish creates a generated ATTIM slug and prints the live URL on the first line. If the site is anonymous, ATTIM returns a claimToken once; save it if you need to update, delete, or claim the site later.

clone copies an anonymous live source site into a new anonymous site and prints a new one-time claimToken. fork copies an anonymous live source site into your authenticated account as an owned site.

  • Directory publishes require a root index.html.
  • Single-file publishes are uploaded as index.html.
  • --slug requires account authentication and creates an owned site.
  • --password enables password protection during publish.
  • --password-access-ttl sets the access duration for publish-time password protection.
  • --no-finalize uploads files but leaves the version pending.
  • --dry-run builds and validates the local manifest without API or upload calls.
  • --json prints machine-readable JSON.

Forking and cloning

attim clone source-site --ttl 86400
attim fork source-site --slug my-copy --token attim_uat_...
  • clone creates an anonymous copy with independent storage and a new claimToken.
  • fork creates an owned copy and requires an account API token.
  • The first release copies static files and basic metadata, not passwords, paywalls, grants, or source claim tokens.

Updating an existing site

attim update my-site ./dist
attim update my-site ./dist --token attim_uat_...
attim update my-site ./dist --claim-token ANONYMOUS_CLAIM_TOKEN
attim update my-site ./dist --dry-run

Lifecycle commands

attim finalize my-site 12 --claim-token ANONYMOUS_CLAIM_TOKEN
attim delete my-site --token attim_uat_...
attim info my-site
attim list

Public variables

Public variables let you customize claimed sites without editing uploaded files. Placeholders like {{ vars.PRODUCT_NAME }} in text files are replaced at serve time.

attim variables list my-site
attim variables list my-site --token attim_uat_...
attim variables set my-site API_BASE_URL https://api.example.com --token attim_uat_...
attim variables delete my-site API_BASE_URL --token attim_uat_...

Values are inserted literally and may be visible in page source. Do not store passwords or private API keys in public variables.

Password protection

Password-protect a site so visitors must enter a password before viewing content. This works for both anonymous and claimed sites.

# Enable on an owned site
attim password enable my-site secret-password --access-ttl 86400 --token attim_uat_...
 
# Enable on an anonymous site using its claim token
attim password enable my-site secret-password --claim-token ANONYMOUS_CLAIM_TOKEN
 
# Disable
attim password disable my-site --token attim_uat_...
  • --access-ttl controls how long a successful password unlock lasts (in seconds). Default is server-configured.
  • Anonymous sites require --claim-token or ATTIM_CLAIM_TOKEN.
  • Claimed sites require an account API token.
  • You can also enable password protection during publish with --password.

x402 paywalls

x402 paywalls let you charge visitors a small amount to access a claimed site for a configured duration.

First, set a payment wallet:

attim wallet
attim wallet set 0x0000000000000000000000000000000000000001 --network eip155:8453 --token attim_uat_...
attim wallet clear --network eip155:8453 --token attim_uat_...

Then enable a paywall on a site:

attim paywall enable my-site 0.25 --network eip155:8453 --access-ttl 86400 --token attim_uat_...
attim paywall disable my-site --network eip155:8453 --token attim_uat_...
  • priceUsd is the price in US dollars (e.g., 0.25 for 25 cents).
  • --network uses CAIP-2 network identifiers like eip155:8453 (Base). Defaults to the server default.
  • --access-ttl controls how long payment access lasts (in seconds).
  • Paywalls require a configured wallet for the selected network.
  • Paywall commands require an account API token.

Diagnostics

Run attim doctor to check local Node support, ATTIM API reachability, config location, and token validity.

Run attim list after login to list owned sites visible to the saved account API token.

Global options

  • --base-url <url>: ATTIM base URL. Defaults to https://attim.link or ATTIM_BASE_URL.
  • --token <token>: account API token. Defaults to ATTIM_API_TOKEN, then the token saved by attim login.
  • --claim-token <token>: anonymous site management token. Defaults to ATTIM_CLAIM_TOKEN.
  • --ttl <seconds>: TTL for anonymous publishes or clones.
  • --slug <slug>: explicit destination slug for authenticated publishes or forks.
  • --json: print machine-readable JSON.
  • --help: show usage.
  • --version: show the CLI version.

Notes

  • Publish and update print progress to stderr for interactive runs. --json keeps stdout machine-readable.
  • Uploads run with bounded concurrency and retry transient upload failures.
  • MCP is served by the backend at /mcp; account API tokens enable the full tool set, while anonymous MCP can be enabled server-side for limited claim-token-controlled publishing tools.