> ## Documentation Index
> Fetch the complete documentation index at: https://docs.declaw.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# base — shell tools end-to-end

> Boot the base template and run git, curl, and jq in a single pipeline — the smallest useful Declaw sandbox.

The `base` template is a minimal `Ubuntu 22.04` image with `git`, `curl`,
`wget`, `jq`, `build-essential`, `openssh-client`, and `unzip`. Pick it
when you only need shell utilities or want the smallest possible image to
install your own toolchain on top of.

## What you'll learn

* Picking `template="base"` for shell-only workloads
* Running a multi-tool pipeline (`curl` → `jq`) inside a sandbox
* Inspecting what ships in the `base` image with `which` / `--version`

## Prerequisites

<Snippet file="snippets/env-setup.mdx" />

## Code

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from declaw import Sandbox


    def main() -> None:
        sbx = Sandbox.create(template="base", timeout=120)
        try:
            # 1. Confirm what's preinstalled.
            for tool in ("git", "curl", "jq", "wget"):
                r = sbx.commands.run(f"{tool} --version")
                first_line = (r.stdout or r.stderr).splitlines()[0]
                print(f"{tool}: {first_line}")

            # 2. Use them together: clone a tiny repo, then list files.
            r = sbx.commands.run(
                "cd /tmp && "
                "git clone --depth 1 https://github.com/jqlang/jq.git jq-src && "
                "ls jq-src | head -5"
            )
            print("\nclone output:")
            print(r.stdout)

            # 3. curl + jq pipeline against a public JSON endpoint.
            r = sbx.commands.run(
                'curl -s https://api.github.com/repos/jqlang/jq '
                '| jq "{name: .name, stars: .stargazers_count, language: .language}"'
            )
            print("repo summary:")
            print(r.stdout)
        finally:
            sbx.kill()


    if __name__ == "__main__":
        main()
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={null}
    import "dotenv/config";
    import { Sandbox } from "@declaw/sdk";

    async function main(): Promise<void> {
      const sbx = await Sandbox.create({ template: "base", timeout: 120 });
      try {
        for (const tool of ["git", "curl", "jq", "wget"]) {
          const r = await sbx.commands.run(`${tool} --version`);
          const firstLine = (r.stdout || r.stderr).split("\n")[0];
          console.log(`${tool}: ${firstLine}`);
        }

        let r = await sbx.commands.run(
          "cd /tmp && " +
            "git clone --depth 1 https://github.com/jqlang/jq.git jq-src && " +
            "ls jq-src | head -5",
        );
        console.log("\nclone output:");
        console.log(r.stdout);

        r = await sbx.commands.run(
          "curl -s https://api.github.com/repos/jqlang/jq " +
            '| jq "{name: .name, stars: .stargazers_count, language: .language}"',
        );
        console.log("repo summary:");
        console.log(r.stdout);
      } finally {
        await sbx.kill();
      }
    }

    main().catch(console.error);
    ```
  </Tab>
</Tabs>

## Expected output

```
git: git version 2.34.1
curl: curl 7.81.0 (x86_64-pc-linux-gnu) ...
jq: jq-1.6
wget: GNU Wget 1.21.2 ...

clone output:
AUTHORS
COPYING
ChangeLog
Makefile.am
README.md

repo summary:
{
  "name": "jq",
  "stars": 30000,
  "language": "C"
}
```

<Note>
  `base` does not ship Python or Node. If you `apt-get install python3` at
  runtime it will work, but you'll wait for the install on every sandbox boot
  — picking `template="python"` or `template="node"` is faster.
</Note>
