🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

create-atlas-agent

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-atlas-agent

Create a new Atlas text-to-SQL agent project

latest
Source
npmnpm
Version
0.3.3
Version published
Maintainers
1
Created
Source

create-atlas-agent

Deploy a text-to-SQL data analyst agent on your database in minutes. Ask natural language questions, get validated SQL and interpreted results.

What you get: A self-contained project with a chat UI, multi-layer SQL validation, auto-generated semantic layer from your schema, and deploy configs for Docker, Railway, and Vercel.

Quick start

bun create atlas-agent my-app
cd my-app
bun run dev

Open http://localhost:3000 and start asking questions about your data.

Prerequisites

  • Bun 1.3+
  • A database (PostgreSQL or MySQL)
  • An LLM API key (Anthropic, OpenAI, AWS Bedrock, or Ollama for local models)

Interactive setup

Running bun create atlas-agent my-app walks you through each option:

PromptOptionsDefault
Project nameAny valid directory namemy-atlas-app
PlatformDocker, Railway, Vercel, OtherDocker
Sandboxnsjail, Sidecar, E2B, Daytona, None (only for "Other" platform)nsjail
DatabasePostgreSQL, MySQLPostgreSQL
Connection stringYour database URLpostgresql://atlas:atlas@localhost:5432/atlas
LLM providerAnthropic, OpenAI, AWS Bedrock, Ollama, Vercel AI GatewayAnthropic
API keyYour provider's API key--
Model overrideAny model ID supported by your providerProvider default
Demo dataLoad a demo dataset (PostgreSQL only)No
Generate semantic layerProfile your database and generate YAMLNo

Non-interactive mode

Skip all prompts with sensible defaults (PostgreSQL + Anthropic + Docker):

bun create atlas-agent my-app --defaults
# or
bun create atlas-agent my-app -y

Note: The published package name is create-atlas-agent. bun create atlas-agent <name> is the canonical invocation. The legacy @useatlas/create package on npm is deprecated and points here.

Platform flag

Skip the platform prompt:

bun create atlas-agent my-app --platform vercel
bun create atlas-agent my-app --platform railway

Available platforms: vercel, railway, docker, other

Demo datasets

Atlas includes built-in demo datasets for PostgreSQL. The setup wizard offers to load one for you, or you can load them later with bun run atlas -- init --demo.

DatasetTablesRowsDescription
Simple3~330Companies, people, accounts. Quick start
Cybersecurity SaaS62~500KFull SaaS platform with users, alerts, incidents, assets, compliance
E-commerce (NovaMart)52~480KDTC brand + marketplace with orders, inventory, customers, analytics

Demo data is not available for MySQL. Use your own database and run bun run atlas -- init to generate the semantic layer.

Deploy

Each platform gets the right template and sandbox configuration automatically.

Docker (self-hosted)

nsjail process isolation is built into the Docker image.

bun create atlas-agent my-app --platform docker
cd my-app

# Generate semantic layer from your database
bun run atlas -- init

# Build and run
docker build -t my-app .
docker run -p 3001:3001 --env-file .env my-app

Verify: curl http://localhost:3001/api/health

Railway

Uses a sidecar container for sandbox isolation via Railway's internal networking.

bun create atlas-agent my-app --platform railway
cd my-app
  • Push to GitHub
  • Create a Railway project with two services:
    • Main service -- your repo root (uses railway.json)
    • Sidecar -- the sidecar/ directory (uses sidecar/railway.json)
  • Add a Postgres plugin (Railway auto-injects DATABASE_URL)
  • Set env vars on the main service: ATLAS_PROVIDER, provider API key, ATLAS_DATASOURCE_URL
  • Set SIDECAR_AUTH_TOKEN on both services (pre-generated in .env)

Vercel

Deploys as a Next.js app with the API embedded via a catch-all route. Explore tool auto-detects Vercel Sandbox (Firecracker VM isolation).

bun create atlas-agent my-app --platform vercel
cd my-app
  • Push to GitHub and import in the Vercel Dashboard
  • Set env vars: ATLAS_PROVIDER, provider API key, ATLAS_DATASOURCE_URL, DATABASE_URL (Postgres for auth and audit)
  • Deploy

Semantic layer

The semantic layer is a set of YAML files that describe your database schema, relationships, and query patterns. Atlas uses it to write accurate SQL.

Generate it from your database. If you chose "Generate semantic layer" during setup, the scaffolder already ran atlas init --enrich for you.

# Basic profiling
bun run atlas -- init

# With LLM enrichment (adds descriptions, query patterns, virtual dimensions)
bun run atlas -- init --enrich

# Profile specific tables only
bun run atlas -- init --tables users,orders,products

# Check for schema drift
bun run atlas -- diff

Environment variables

Required

VariableExampleDescription
ATLAS_PROVIDERanthropicLLM provider (anthropic, openai, bedrock, ollama, gateway)
Provider API keyANTHROPIC_API_KEY=sk-ant-...Depends on provider
ATLAS_DATASOURCE_URLpostgresql://user:pass@host:5432/dbYour analytics database

Optional

VariableDefaultDescription
DATABASE_URL--Atlas internal Postgres (auth, audit). Auto-set on most platforms
ATLAS_MODELProvider defaultOverride the LLM model
ATLAS_ROW_LIMIT1000Max rows per query
ATLAS_QUERY_TIMEOUT30000Query timeout in ms
ATLAS_SANDBOXauto-detectSet to nsjail to enforce nsjail isolation
ATLAS_SANDBOX_URL--Sidecar service URL for sandbox isolation
SIDECAR_AUTH_TOKEN--Shared secret between main service and sidecar
ATLAS_API_KEY--Enable simple API key auth
BETTER_AUTH_SECRET--Enable managed auth (min 32 chars, requires DATABASE_URL)
ATLAS_RATE_LIMIT_RPMdisabledMax requests per minute per user

Provider API keys

ProviderEnv varDefault model
AnthropicANTHROPIC_API_KEYclaude-opus-4-6
OpenAIOPENAI_API_KEYgpt-4o
AWS BedrockAWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY + AWS_REGIONanthropic.claude-opus-4-6-v1:0
OllamaOLLAMA_BASE_URLllama3.1
Vercel AI GatewayAI_GATEWAY_API_KEYanthropic/claude-opus-4.6

Useful commands

bun run dev              # Start dev server (http://localhost:3000)
bun run build            # Production build
bun run start            # Start production server
bun run atlas -- init    # Generate semantic layer from database
bun run atlas -- diff    # Check for schema drift
bun run db:up            # Start local Postgres via Docker Compose
bun run db:down          # Stop local Postgres
bun run db:reset         # Reset local Postgres (fresh data)
bun run test             # Run tests
bun run lint             # Lint with ESLint

Troubleshooting

"bun: command not found" -- Install Bun: curl -fsSL https://bun.sh/install | bash

"Database is not reachable" -- Check your connection string. For local Postgres, run bun run db:up first. Ensure the database exists and accepts connections.

"ANTHROPIC_API_KEY is required" -- Edit .env and set a real API key. If you used --defaults, the file contains a placeholder.

"No semantic layer found" -- Run bun run atlas -- init to generate YAML files from your database schema. The agent needs these to write SQL.

Docker build fails with nsjail errors -- nsjail requires Linux. On macOS, build with docker build --platform linux/amd64 -t my-app . or skip nsjail: add --build-arg INSTALL_NSJAIL=false.

"Connection refused" on Railway -- Ensure ATLAS_DATASOURCE_URL uses an external hostname, not localhost. For the sidecar, verify both services share the same SIDECAR_AUTH_TOKEN.

License

MIT — see LICENSE

Keywords

atlas

FAQs

Package last updated on 03 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts