Freestyle VMs are full Linux virtual machines designed for long running, complex tasks.
Install
pnpm add freestyle@latestbun add freestyle@latestnpm install freestyle@latestyarn add freestyle@latest Set your API key before calling the API:
export FREESTYLE_API_KEY="your-api-key"
Create A VM
import { Freestyle } from "freestyle";
const freestyle = new Freestyle();
const { vm } = await freestyle.vms.create({
// Required: a VM reaches nothing it has not been allowed to.
firewall: { rules: [{ action: "allow", source: {}, destination: { public: true } }] },
});
const result = await vm.exec("echo 'hello from freestyle'");
console.log(result);
Next Steps
- Freestyle CLI for terminal commands.
- Freestyle VMs for VM lifecycle, files, SSH, and client sessions.