Skip to content

ArkerHQ/arker-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arker SDKs

Spawn isolated Linux VMs in milliseconds. Run code. Sync files.

Three primitives. Zero infrastructure.

PyPI npm License

Quickstart · Primitives · Python · TypeScript · arker.ai


Quickstart

Python

pip install arker
from arker import Arker

arker = Arker(
    api_key="ark_live_...",
    region="aws-us-west-2",
)
vm = arker.vm("ubuntu").fork(name="hello")
result = vm.run("python3 -c 'print(2+2)'")
if result.type == "completed":
    print(result.stdout.decode())   # -> "4\n"
vm.delete()

TypeScript

npm install @arker-ai/sdk
import { Arker } from "@arker-ai/sdk";

const arker = new Arker({
  apiKey: "ark_live_...",
  region: "aws-us-west-2",
});
const vm = await arker.vm("ubuntu").fork({ name: "hello" });
const result = await vm.run("node -e 'console.log(2+2)'");
if (result.type === "completed") {
  console.log(new TextDecoder().decode(result.stdout));  // -> "4\n"
}
await vm.delete();

The three primitives

Examples below use Python. See typescript/README.md for the TypeScript surface.

fork  ·  instant VMs

vm    = arker.vm("ubuntu").fork()        # fresh VM from a base image
child = vm.fork(name="branch")           # branch an existing VM

Constant-time. The child is bit-identical to its parent at the moment of fork — same files, same last-known process state, same everything — and from that moment on, writes to either side don't affect the other. Fork to spin up a clean environment, branch a known-good state to try a risky operation, or run N variants in parallel from a single configured VM.

run  ·  execute anything

result = vm.run("python3 -c 'print(2+2)'")
print(result.stdout.decode())            # → "4\n"
print(result.exit_code)

Shell, Python, Node — anything installed inside the VM. State persists across calls in a session, so a cd /tmp sticks for the next ls, and Python globals defined in one vm.run(...) are still there in the next. Completed runs return structured output with stdout, stderr, and exit_code — no parsing required.

sync  ·  file I/O up to 100 MB

vm.sync.write_file("/home/user/data.bin", b"...")
back = vm.sync.read_file("/home/user/data.bin")    # → bytes

Read and write raw bytes — files up to 100 MB. Small payloads go in one round-trip; larger ones take a direct upload path the SDK manages transparently. Files written from the SDK are immediately visible to shell commands inside the VM, and files the VM writes are readable from the SDK — same filesystem, same view, both directions.


Languages

Language Package Source Status
Python arker python/ alpha
TypeScript @arker-ai/sdk typescript/ alpha

Each SDK lives in its own subdirectory with a dedicated README and tests. See python/README.md for the full Python API reference.

Releasing

Each SDK is versioned independently via tag-prefixed releases:

  • Python — push python-vX.Y.Z (must match python/pyproject.toml). GitHub Actions builds and publishes to PyPI via Trusted Publishing.
  • TypeScript — push typescript-vX.Y.Z (must match typescript/package.json). GitHub Actions builds (ESM + CJS + types) and publishes to npm via Trusted Publishing with provenance.

License

Apache-2.0. See LICENSE.

About

Official SDKs for the Arker virtual computer platform — spawn sandboxed VMs, run code, sync files.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors