- CLI
- Python
- TypeScript
- Rust
1
Create a Sail account
Sign up at the Sail dashboard.2
Install the Sail CLI
# macOS and Linux
curl -fsSL https://cli.sailresearch.com/install.sh | sh
# Windows PowerShell
irm https://cli.sailresearch.com/install.ps1 | iex
3
Create and connect to your first Sailbox
$ sail shell # open the Sailbox TUI
sail ▶ create --app sailbox-quickstart --name quickstart # create a Sailbox
sail ▶ connect # connect to the Sailbox as root
root@quickstart:~# ...
root@quickstart:~# exit # return to sail shell
sail ▶ top # view live Sailbox usage
sail ▶ terminate # terminate the Sailbox
sail ▶ exit # close sail shell
1
Create a Sail account
Sign up at the Sail dashboard.2
Install the Python SDK
pip install sail
# or
uv add sail
3
Authenticate
sail auth login
4
Create and run a Sailbox
Createquickstart.py:import sail
app = sail.App.find(name="sailbox-quickstart", mint_if_missing=True)
sb = sail.Sailbox.create(app=app, name="quickstart")
result = sb.run("python3 -c 'print(\"hello world\")'")
print(result.stdout)
sb.fs.write("/tmp/note.txt", "from my machine")
print(sb.fs.read("/tmp/note.txt").decode())
sb.terminate()
5
Run it
python quickstart.py
1
Create a Sail account
Sign up at the Sail dashboard.2
Install the TypeScript SDK
npm install @sailresearch/sdk
npm install --save-dev tsx
3
Install the Sail CLI
# macOS and Linux
curl -fsSL https://cli.sailresearch.com/install.sh | sh
# Windows PowerShell
irm https://cli.sailresearch.com/install.ps1 | iex
4
Authenticate
sail auth login
5
Create and run a Sailbox
Createquickstart.ts:import { App, Sailbox } from "@sailresearch/sdk";
async function main() {
const app = await App.find("sailbox-quickstart", { mintIfMissing: true });
const sb = await Sailbox.create({ app, name: "quickstart" });
try {
const hello = await sb.run(["python3", "-c", "print('hello world')"]);
console.log(hello.stdout);
await sb.fs.write("/tmp/note.txt", "from my machine");
console.log((await sb.fs.read("/tmp/note.txt")).toString());
} finally {
await sb.terminate();
}
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
6
Run it
npx tsx quickstart.ts
1
Create a Sail account
Sign up at the Sail dashboard.2
Install the Rust SDK
cargo new hello-sail && cd hello-sail
cargo add sail-rs
cargo add tokio --features macros,rt-multi-thread
3
Install the Sail CLI
# macOS and Linux
curl -fsSL https://cli.sailresearch.com/install.sh | sh
# Windows PowerShell
irm https://cli.sailresearch.com/install.ps1 | iex
4
Authenticate
sail auth login
5
Create and run a Sailbox
Replacesrc/main.rs with:use sail::{
BaseImage, Client, CreateSailboxRequest, ImageArchitecture, ImageSpec, RunOptions, SailError,
WriteOptions,
};
#[tokio::main]
async fn main() -> Result<(), SailError> {
let client = Client::from_env()?;
let app = client
.find_app("sailbox-quickstart", /* mint_if_missing */ true)
.await?;
let sb = client
.create_sailbox(
&CreateSailboxRequest {
app_id: app.id,
name: "quickstart".into(),
image: ImageSpec {
base: Some(BaseImage::Debian),
architecture: ImageArchitecture::Arm64,
..Default::default()
},
..Default::default()
},
/* timeout */ None,
)
.await?;
let result = async {
let hello = sb
.run(
["python3", "-c", "print('hello world')"],
RunOptions::default(),
)
.await?;
print!("{}", hello.stdout);
sb.fs()
.write("/tmp/note.txt", b"from my machine", WriteOptions::default())
.await?;
let note = sb.fs().read("/tmp/note.txt").await?;
println!("{}", String::from_utf8_lossy(¬e));
Ok::<(), SailError>(())
}
.await;
let terminate_result = sb.terminate().await;
result?;
terminate_result?;
Ok(())
}
6
Run it
cargo run
Next steps
- Build custom dependencies into the root filesystem with Images.
- Learn runtime file transfer in Filesystem.
- Expose HTTP, raw TCP, and SSH with Networking.
- Checkpoint, clone from checkpoints, pause, and sleep VMs in Lifecycle.