# CLI
Source: https://docs.runalph.ai/cli
Run and connect a JupyterLab server to Alph from anywhere
## Installation
```bash theme={null}
pip install alphai
```
## Authentication
```bash theme={null}
alphai login
```
This opens your browser for secure authentication. Alternatively, use a token from [runalph.ai/account/tokens](https://runalph.ai/account/tokens):
```bash theme={null}
alphai login --token YOUR_TOKEN
```
## Start JupyterLab
```bash theme={null}
alphai jupyter lab
```
This starts JupyterLab locally and connects it to Alph. You'll be prompted to select an organization and project.
## Common Options
```bash theme={null}
# Specify org and project
alphai jupyter lab --org my-org --project my-project
# Use a specific port for the notebook server
alphai jupyter lab --port 8889
# Expose a web app through Alph's tunnel
alphai jupyter lab --app-port 5000
```
## Quick Reference
```bash theme={null}
alphai login # Authenticate
alphai logout # Clear credentials
alphai status # Check auth status
alphai orgs # List organizations
alphai projects # List projects
alphai nb # Manage notebooks
alphai jupyter lab # Start JupyterLab
```
# AI and Agents
Source: https://docs.runalph.ai/concepts/ai
Built-in AI agents across notebooks and projects
## AI in Alph
AI is woven into the platform — not bolted on. Generate code, chat about your work, and run autonomous agents, all with context from your notebooks and project files.
## Models
Three providers, choose per-conversation:
* **Claude** (Anthropic)
* **GPT** (OpenAI)
* **Gemini** (Google)
## The AI Editor
Every project includes an AI editor — an agent that operates as a pair programmer with full control over your environment.
**Access:** `https://runalph.ai/{org}/{project}/ide`
The agent can:
* **Create and execute notebook cells** — write Python, run it, read the output, iterate
* **Create and edit files** — scripts, configs, data files, anywhere in your project
* **Debug errors** — read tracebacks, fix code, re-run automatically
* **Install packages** — run shell commands to set up dependencies
* **Read outputs** — interpret plots, dataframes, and errors to decide next steps
Create multiple chats for different tasks. Chats persist across sessions. The agent has full access to your project's filesystem and kernels — it works like having a developer inside your environment.
Agents run server-side, so you can dispatch a task and close your browser. Come back later to check progress, review what the agent did, and continue the conversation.
## In Notebooks
### Generate in a Cell
Press `Ctrl/Cmd + K` while editing a cell. Describe what you want and the AI writes it, using your notebook's imports, variables, and prior cells as context.
### Generate New Cells
| Shortcut | Action |
| --------- | ------------------------------ |
| `F` / `G` | AI code cell above / below |
| `S` / `D` | AI markdown cell above / below |
Or click the **+ AI** buttons between cells.
### Tips
* Be specific: *"histogram of age column with 20 bins"* not *"make a chart"*
* Use markdown cells to describe your goals — AI reads them for context
* Iterate: refine your prompt if the first result isn't right
## Generators
Beyond notebooks, AI can generate:
* Python scripts
* Terminal commands
* CSV, JSON, HTML, SVG
* Markdown documentation
* Images
These are available contextually throughout the platform.
# GitHub Sync
Source: https://docs.runalph.ai/concepts/github-sync
Import, sync, and view notebooks from GitHub repositories
## Overview
Alph integrates deeply with GitHub — import notebooks from repos, sync changes bidirectionally with cell-level diffs, and view any public notebook without cloning.
**Important:** Imported and synced notebooks live in Alph. They're full Alph notebooks with AI assistance, execution, and publishing. The GitHub connection is for syncing content — the notebook itself is hosted on the platform.
The `gitalph.com` viewer is separate — it renders notebooks directly from GitHub for quick viewing without importing.
## Connecting GitHub
From your organization settings, click **Integrations**
Click **Connect GitHub** and authorize the Alph GitHub App
Choose which repos to give Alph access to
## Importing Notebooks
1. Go to **Notebooks** → **Import** → **From GitHub**
2. Browse your connected repositories
3. Select notebooks to import (single or bulk)
4. Set title, visibility, and tags
5. Click **Import**
Once imported, the notebook is an Alph notebook. Edit it with AI, execute code, publish it — everything works.
You can also drag-and-drop `.ipynb` files directly.
## Bidirectional Sync
Once a notebook is connected to a GitHub repo, changes flow both ways.
**Pull** — fetch the latest version from GitHub into Alph.
**Push** — commit your changes back to the repo. You can push directly to a branch or open a pull request with a custom commit message.
**Status indicators** show when your notebook is ahead (local changes), behind (remote changes), or both (needs merge).
### Cell-Level Diffs
Before pulling or pushing, review exactly what changed — cell by cell.
* Added, removed, and modified cells are color-coded
* Source code shows line-by-line unified diffs
* Output changes are displayed side-by-side
* Markdown cells show rendered previews
This isn't a raw JSON diff. It's a structured comparison that understands notebook semantics.
### Auto-Sync
Sync stays active by default. You can pause it (unsync) and resume later (reconnect) without losing the GitHub connection.
## GitHub Notebook Viewer
Any public GitHub notebook is available in Alph. Just swap `github.com` for `gitalph.com` in the URL:
```
github.com/owner/repo/blob/main/notebook.ipynb
→ gitalph.com/owner/repo/blob/main/notebook.ipynb
```
This isn't just a viewer — it's a full Alph notebook. Connect a project and execute cells, use AI assistance, chat about the code. Every `.ipynb` on GitHub is one URL swap away from being a live, runnable notebook.
## Managing Access
* **Add repos:** Integrations → GitHub → Configure
* **Disconnect:** GitHub Settings → Applications → Uninstall Alph
# Notebooks
Source: https://docs.runalph.ai/concepts/notebooks
Standard Jupyter notebooks with AI, search, and publishing built in
## What are Notebooks?
Notebooks are standard Jupyter `.ipynb` files — no lock-in. You can create, edit, and share them without any compute. To execute code, connect one to a [project](/concepts/projects).
## Creating a Notebook
1. Go to **Notebooks** in your organization
2. Click **New Notebook**
3. Set a title and visibility
4. Start writing
You can also import from GitHub or drag-and-drop `.ipynb` files.
## The Editor
Notebooks have two cell types: **code** and **markdown**. Switch modes with `Enter` (edit) and `Esc` (command).
| Shortcut | Action |
| ------------------ | -------------------------- |
| `Shift + Enter` | Run cell, move to next |
| `Ctrl/Cmd + Enter` | Run cell in place |
| `A` / `B` | Insert cell above / below |
| `X` | Delete cell |
| `M` / `Y` | Convert to markdown / code |
## Execution
To run code, connect your notebook to a project's kernel:
1. Open the notebook
2. Select an **Organization** and **Project**
3. Run cells with `Shift + Enter`
The kernel provides a Python runtime. Install packages with `!pip install` and restart the kernel afterward.
## AI Assistance
AI is built into the editor. No extensions needed.
* **Prompt in cell:** `Ctrl/Cmd + K` to generate content for the current cell
* **Generate cells:** Press `F`/`G` for code or `S`/`D` for markdown (above/below)
* **Chat panel:** Ask questions about your code with context from your notebook
Works with Claude, GPT, and Gemini. See [AI](/concepts/ai) for details.
## Publishing & Sharing
Toggle a notebook to **Public** to make it searchable and shareable.
* **Direct link:** `https://runalph.ai/{org}/~/notebooks/{slug}`
* **Embed:** `` — see [Embed Notebooks](/guides/embed-notebooks) for full options
* **Export:** Download as `.ipynb`, HTML, PDF, Markdown, or Python script
## Semantic Search
Find notebooks and individual cells by meaning, not just keywords.
1. Go to **Notebooks** (global)
2. Search with natural language (e.g., *"sentiment analysis with transformers"*)
3. Filter by tags, author, or date
Search works at both notebook and cell level — find specific implementations across the entire platform.
## Forking
Fork any public notebook to get your own copy. Edit freely without affecting the original.
# Projects
Source: https://docs.runalph.ai/concepts/projects
Cloud compute environments with JupyterLab, terminals, and web app hosting
## What are Projects?
Projects are JupyterLab servers running on cloud compute. They provide kernels for notebooks, shell access, file storage, and web app hosting — all in an isolated environment.
**Access:** `https://runalph.ai/{org-slug}/{project-slug}`
## Automations
Schedule recurring tasks that run in your project — notebook cells or AI agents on a cron. See guides for [notebook automations](/guides/automate-notebooks) and [agent automations](/guides/automate-agents).
## AI Editor
Every project includes an AI-powered IDE. The agent can create and execute notebook cells, read outputs, create and edit files, debug errors, and iterate — all from a chat interface. See [AI and Agents](/concepts/ai) for details.
**Access:** `https://runalph.ai/{org}/{project}/ide`
## Creating a Project
1. Go to **Projects** in your organization
2. Click **New Project**
3. Enter a name and slug
4. Select a compute type
5. Click **Create**
## Compute Types
| Type | CPU | RAM | Use Case |
| ---------- | --- | ----- | -------------------- |
| **Micro** | 0.5 | 1 GB | Light tasks, testing |
| **Small** | 2 | 4 GB | Data analysis |
| **Medium** | 4 | 8 GB | ML training |
| **Large** | 8 | 16 GB | Large datasets |
| **XLarge** | 16 | 32 GB | Heavy workloads |
GPU instances are also available. Change compute type anytime in **Settings > Compute** (restarts the server).
## Terminals
Full shell access in your browser. Install packages, run scripts, manage files. Claude Code comes pre-installed in every project — open a terminal and run `claude` to start.
Create multiple terminal sessions and switch between them. Sessions persist until the project stops.
## Kernels
Monitor running kernels at **Kernels** in your project:
* See kernel status (idle, busy, starting)
* View attached notebook sessions
* Shut down individual kernels or all at once
## Web App Hosting
Run any web framework and get a public URL automatically.
1. Start your app on port 5000, bound to `0.0.0.0`
2. Your app is live at `https://{org}-{project}.runalph.dev`
Works with Streamlit, Gradio, Flask, FastAPI, and anything else that serves HTTP. Add a custom domain in **Settings > Domains**.
## Local Projects
Use your own hardware instead of cloud compute:
```bash theme={null}
alphai jupyter lab --org my-org --project my-project
```
This connects a local JupyterLab to Alph. No compute charges — use your laptop, workstation, or cloud VM. Add `--app-port 5000` to expose a web app through the tunnel. See the [Bring Your Own GPU](/guides/bring-your-own-gpu) guide.
# Anthropic
Source: https://docs.runalph.ai/examples/anthropic
Build with Claude from a runnable embedded notebook
This notebook is live. It's powered by a project server — dependencies installed, API keys configured, parameters ready to tweak. Hit run and it just works.
Want to power it yourself? Connect your own project to the same embed below. Anyone can set this up for their own notebooks at [runalph.ai/embed](https://runalph.ai/embed).
### Managed
Runs on a pre-configured project. Read-only source, editable parameters.
### Bring Your Own Project
Same notebook, no embed config. Sign in and connect your own project to run it.
# LanceDB
Source: https://docs.runalph.ai/examples/lancedb
Embedded vector database with LanceDB from a runnable embedded notebook
This notebook is live. It's powered by a project server — dependencies installed, API keys configured, parameters ready to tweak. Hit run and it just works.
Want to power it yourself? Connect your own project to the same embed below. Anyone can set this up for their own notebooks at [runalph.ai/embed](https://runalph.ai/embed).
### Managed
Runs on a pre-configured project. Read-only source, editable parameters.
### Bring Your Own Project
Same notebook, no embed config. Sign in and connect your own project to run it.
# Modal Labs
Source: https://docs.runalph.ai/examples/modal
Run Modal serverless functions from a runnable embedded notebook
This notebook is live. It's powered by a project server — dependencies installed, API keys configured, parameters ready to tweak. Hit run and it just works.
Want to power it yourself? Connect your own project to the same embed below. Anyone can set this up for their own notebooks at [runalph.ai/embed](https://runalph.ai/embed).
### Managed
Runs on a pre-configured project. Read-only source, editable parameters.
### Bring Your Own Project
Same notebook, no embed config. Sign in and connect your own project to run it.
# OpenAI
Source: https://docs.runalph.ai/examples/openai
Build with GPT from a runnable embedded notebook
This notebook is live. It's powered by a project server — dependencies installed, API keys configured, parameters ready to tweak. Hit run and it just works.
Want to power it yourself? Connect your own project to the same embed below. Anyone can set this up for their own notebooks at [runalph.ai/embed](https://runalph.ai/embed).
### Managed
Runs on a pre-configured project. Read-only source, editable parameters.
### Bring Your Own Project
Same notebook, no embed config. Sign in and connect your own project to run it.
# Qdrant
Source: https://docs.runalph.ai/examples/qdrant
Vector search with Qdrant from a runnable embedded notebook
This notebook is live. It's powered by a project server — dependencies installed, API keys configured, parameters ready to tweak. Hit run and it just works.
Want to power it yourself? Connect your own project to the same embed below. Anyone can set this up for their own notebooks at [runalph.ai/embed](https://runalph.ai/embed).
### Managed
Runs on a pre-configured project. Read-only source, editable parameters.
### Bring Your Own Project
Same notebook, no embed config. Sign in and connect your own project to run it.
# Automate Agents on a Schedule
Source: https://docs.runalph.ai/guides/automate-agents
Run AI agents automatically on a recurring schedule
## Why
Combine AI with automation. Instead of pre-written notebook cells, give an AI agent a prompt and a schedule. The agent decides what to do each run — adapting to new data, changing conditions, or evolving requirements.
## Setup
In your project, click **Automations** → **New Automation**
Select **Agent** as the automation type
* Write a prompt describing what the agent should do
* Select an AI model (Claude, GPT, or Gemini)
* Set a name and cron schedule
* Click **Create**
## Example Prompts
**Daily data summary:**
> Analyze today's sales data in sales\_2024.csv. Write a summary to daily\_reports/ with key metrics and any anomalies.
**Code health check:**
> Run the test suite. If any tests fail, investigate the failures and create a report in debug\_logs/.
**Research digest:**
> Check the latest papers on arxiv related to diffusion models. Summarize the top 3 in a new markdown file.
## How It Works
The agent gets your prompt, access to the project's filesystem and kernels, and runs autonomously. It can create files, execute code, read outputs, and iterate — just like an interactive IDE session, but unattended.
## Managing
* **Toggle** automations on/off
* **View run history** to see what the agent did, including generated files and outputs
* **Edit** the prompt, model, or schedule anytime
Agent automations use AI tokens billed to your organization. The project must be running for automations to execute. Default timeout is 300 seconds.
# Automate Notebooks on a Schedule
Source: https://docs.runalph.ai/guides/automate-notebooks
Run notebook cells automatically on a recurring schedule
## Why
Schedule notebooks to run on a cron — data pipelines, daily reports, model retraining, monitoring dashboards. Write the logic once in a notebook, then let it run itself.
## Setup
Write and test the cells you want to automate. Make sure they run top-to-bottom without manual intervention.
In your project, click **Automations** → **New Automation**
Select **Notebook** as the automation type
* Select the notebook
* Optionally limit to a range of cells (e.g., only the data refresh section)
* Set a name and cron schedule
* Click **Create**
## Managing
* **Toggle** automations on/off from the list
* **View run history** to see past executions and outputs
* **Edit** the schedule or cell range anytime
## Use Cases
* **ETL pipelines:** Pull data, transform, and write to a database on schedule
* **Reports:** Generate and email daily/weekly summaries
* **Model retraining:** Re-fit models on new data nightly
* **Monitoring:** Run health checks and alert on anomalies
Automations run within your project's compute. The project must be running for automations to execute. Default timeout is 300 seconds.
# Bring Your Own GPU
Source: https://docs.runalph.ai/guides/bring-your-own-gpu
Connect any machine to Alph using the CLI
## Why
Use your own hardware — a cloud GPU instance, a local workstation, or a beefy VM — while keeping Alph's notebook editor, AI assistance, and collaboration features. No compute charges from Alph.
## Setup
On your machine:
```bash theme={null}
pip install alphai
```
```bash theme={null}
alphai login
```
```bash theme={null}
alphai jupyter lab --org my-org --project my-project
```
This starts JupyterLab locally and connects it to your Alph project via a secure tunnel.
Your notebooks in Alph now execute on your machine's hardware.
## Cloud GPU Examples
### Shadeform
```bash theme={null}
# On your Shadeform GPU instance
pip install alphai
alphai login --token YOUR_TOKEN
alphai jupyter lab --org my-org --project gpu-training
```
### Lambda Labs / Vast.ai / RunPod
Same process — SSH in, install the CLI, and connect. Any machine with Python and internet access works.
### AWS
```bash theme={null}
# On your EC2 GPU instance
pip install alphai
alphai login --token YOUR_TOKEN
alphai jupyter lab --org my-org --project gpu-training
```
### Local Workstation
```bash theme={null}
alphai jupyter lab --org my-org --project local-dev --port 8889
```
## Firewall & Port Configuration
The CLI uses a secure outbound tunnel — no inbound ports need to be open for the notebook connection. However, if you want to expose a web app through Alph, make sure:
* The `--app-port` port (default 5000) is not blocked by your firewall
* Your cloud provider's security group or firewall rules allow the app to bind to `0.0.0.0` on that port
On most cloud GPU providers, outbound traffic is open by default. If you're behind a restrictive firewall, ensure outbound HTTPS (port 443) is allowed for the tunnel.
## What You Get
* **Your hardware, Alph's interface:** Edit notebooks in Alph, execute on your GPU
* **AI assistance:** Cell generation and chat work regardless of where compute runs
* **Team access:** Collaborators see your notebooks and outputs in Alph
* **Web apps:** Add `--app-port 5000` to expose a web app through Alph's tunnel
* **Custom domains:** Attach domains through the web UI — no restart needed
## Tips
* Use `--token` for headless authentication on remote servers
* Use `--port` to change the JupyterLab server port, `--app-port` for the web app port
* Use `tmux` or `screen` to keep the connection alive after disconnecting SSH
* The tunnel auto-reconnects on network interruptions
# Claude Code in Alph Projects
Source: https://docs.runalph.ai/guides/claude-code-remote
Use an Alph project as a remote sandbox for Claude Code
## Why
Claude Code is a CLI coding agent. Every Alph project comes with Claude Code pre-installed — open a terminal and you have a cloud sandbox with persistent storage, configurable compute, and no risk to your local machine.
## Setup
Create a project in your organization and start it. Choose a compute type that matches your workload.
Go to **Terminals** in your project. You now have a shell in your cloud environment.
```bash theme={null}
claude login
claude
```
Claude Code now has full access to your project's filesystem, can install packages, run scripts, and execute code — all in an isolated cloud environment.
## What You Get
* **Isolation:** Claude Code operates in a sandboxed environment, not on your laptop
* **Persistence:** Files and installed packages survive between sessions
* **Compute:** Scale up to XLarge (16 CPU, 32 GB RAM) or GPU instances
* **Web access:** Any app Claude Code starts is accessible via your project's public URL
* **Collaboration:** Team members can see the project files and results
## Tips
* Use a **Medium** or larger instance for builds and heavy operations
* Keep the terminal session open — or use `tmux` to persist long-running tasks
* Combine with the [AI Editor](/concepts/ai) for a multi-agent workflow: Claude Code in the terminal, Alph's AI agent in the notebook
# Deploy a Web App
Source: https://docs.runalph.ai/guides/deploy-web-app
Go from notebook prototype to live web app with a public URL
## Why
You prototyped something in a notebook. Now you want to share it. Alph gives every project a public URL — start a web server and it's live.
## Quick Start
1. Start your app on port 5000, bound to `0.0.0.0`
2. It's live at `https://{org}-{project}.runalph.dev`
That's it. No Docker, no deploy commands, no config files.
## Framework Examples
### Streamlit
```python theme={null}
# app.py
import streamlit as st
st.title('My Dashboard')
st.write('Hello from Alph!')
```
```bash theme={null}
streamlit run app.py --server.port 5000
```
### Gradio
```python theme={null}
import gradio as gr
def greet(name):
return f"Hello {name}!"
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch(server_port=5000, server_name="0.0.0.0")
```
### FastAPI
```python theme={null}
from fastapi import FastAPI
import uvicorn
app = FastAPI()
@app.get("/")
def read_root():
return {"message": "Hello from Alph!"}
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=5000)
```
## Keep It Running
```bash theme={null}
# tmux (recommended)
tmux new -s webapp
python app.py
# Detach: Ctrl+B, then D
# Or nohup
nohup python app.py > app.log 2>&1 &
```
## Custom Domains
Serve from your own domain instead of `runalph.dev`:
1. Go to **Settings > Domains** in your project
2. Add your domain (e.g., `app.example.com`)
3. Create a CNAME record pointing to the tunnel hostname shown
4. Click **Verify** — SSL is provisioned automatically
Works with subdomains and apex domains (if your DNS provider supports CNAME flattening).
# Embed Notebooks
Source: https://docs.runalph.ai/guides/embed-notebooks
Add interactive Jupyter notebooks to any website with a single iframe
## Why
You wrote a notebook. Now you want it on your blog, in your docs, or inside a course. Alph embeds are a single `