CLI Reference
Complete reference for all samplex CLI commands.
samplex login
Authenticate with your Sample.app account.
samplex loginOpens your default browser to sign in using OAuth 2.0 with PKCE. After authentication, tokens are stored locally at ~/.samplex/credentials.json.
Tokens refresh automatically before each command. If a token expires or becomes invalid, run
samplex login again.
samplex deploy
Deploy a static site to a preview URL.
samplex deploy [dir]Arguments
Prop
Type
Options
Prop
Type
How it works
- The CLI archives your build directory as a
.tar.gzwith a SHA-256 integrity hash - Uploads to the Sample.app API
- Files are extracted and served on your preview URL
If a .samplex.config.json exists in the current directory, the CLI reuses the slug from it.
Otherwise, a random name is generated (like brave-panda).
Examples
# Deploy with auto-detected directory
samplex deploy
# Deploy a specific directory with a custom slug
samplex deploy ./dist --slug my-project --name "My Project"Your site is available at:
https://<slug>.sample.appsamplex list
List your deployed sites.
samplex listOutputs a table with each site's slug, URL, view count, bundle size, status, and creation date.
samplex delete
Delete a deployed site permanently.
samplex delete <slug>This action is permanent. It removes the site files and frees your storage quota.
samplex init
Initialize or update project configuration.
samplex init [--slug <slug>] [--name <name>]Creates or updates .samplex.config.json in the current directory. See Project Config for details.
Organization Commands
Configure organization context
samplex init --org <organizationId>Saves the organization ID to .samplex.config.json so subsequent commands target the organization automatically.
Deploy to an organization
# Using config (after init --org)
samplex deploy ./dist
# Using flag
samplex deploy --org <organizationId> ./dist
# Using org API key (auto-detects org)
SAMPLEX_API_KEY=org_xxx samplex deploy ./distList organization sites
samplex list --org <organizationId>Delete an organization site
samplex delete <slug> --org <organizationId>See Organization Sites for more details on deploying to organizations.
Global options
Prop
Type

