TryCli Studio is an full-stack platform that enables developers to host, demo, and share Command Line Interface (CLI) tools directly in the browser.
It orchestrates isolated Docker environments on-demand, providing a seamless "Repl.it-like" experience specifically optimized for terminal applications.
- Instant Sandboxes: Spawns a fresh, isolated Ubuntu container for every user session.
- Snapshot & Publish: Commits the live container state to a Docker image and generates a shareable URL.
- Interactive Guides: Split-pane interface with a rich Markdown editor (GitHub-flavored) and a real-time terminal.
- Modern UI: A "Cyberpunk/VS Code" aesthetic with glassmorphism, dark mode, and responsive layout.
- 100% Rust: Built with a high-performance Rust stack from the kernel to the browser.
- Framework: Axum (Async Web Framework)
- Runtime: Tokio
- Container Engine: Docker (via Bollard)
- Database: PostgreSQL (via SQLx)
- WebSocket: Real-time STDIN/STDOUT streaming via
axum::ws.
- Framework: Leptos (WASM)
- Routing: Leptos Router
- Terminal: xterm.js (via
wasm-bindgen) - Markdown:
pulldown-cmark(Rust-based parsing) - Styling: CSS Variables, Glassmorphism, Google Fonts (Inter + JetBrains Mono).
- Rust & Cargo: (Latest Stable)
- Docker: (Daemon must be running)
- PostgreSQL: (Running locally or via Docker)
- WASM Target:
rustup target add wasm32-unknown-unknown - Trunk:
cargo install trunk
Start a PostgreSQL container on port 5433 to avoid conflicts:
docker run --name trycli-db -e POSTGRES_PASSWORD=password -p 5433:5432 -d postgresNavigate to the server directory and run the API:
cd server
cargo runServer will listen on 0.0.0.0:3000
Navigate to the client directory and start the dev server:
cd client
trunk serve --openBrowser will open at http://localhost:8080
-
Create a Demo:
- Go to
/new. - Wait for the "Initializing Environment..." message to clear.
- Install your CLI tool in the terminal (e.g.,
apt update && apt install ...). - Write instructions in the Markdown editor.
- Enter a unique Slug (e.g.,
my-cool-tool). - Click Publish Demo.
- Go to
-
Share:
- Copy the URL (e.g.,
http://localhost:8080/project/my-cool-tool). - Send it to users. They will get a fresh clone of the environment you set up!
- Copy the URL (e.g.,
TryCli Studio implements a dual-layer security model for embedded projects:
- VIP Pass (embed_key): A private key that grants unrestricted access to embedded projects. Only project owners have access to this key.
- Guest List (whitelist): A list of authorized URLs that can embed the project publicly.
To prevent accidental exposure of the embed_key through browser dev tools or network inspection:
- The
embed_keyis not included in the main project response (/api/project/:username/:slug) - Instead, a dedicated authenticated endpoint (
/api/project/:slug/embed-key) is used to retrieve the key - This endpoint requires authentication and verifies project ownership
- The key is only fetched when the user explicitly clicks the "Share / Embed" button
This separation ensures that:
- Screen sharing during project viewing won't expose the key
- Browser extensions or network logs won't capture the key during normal browsing
- The key is only retrieved when intentionally needed for sharing purposes
- "Container ID not found": Ensure you wait for the terminal to initialize before clicking Publish.
- "RowNotFound": The project slug does not exist in the database.
- Database Connection Refused: Ensure your Docker container is running on port 5433, or update the connection string in
server/src/main.rs.