tar
CLICreate, list, and extract .tar / .tar.gz archives. Preinstalled on macOS and Linux.
Bundle directories into .tgz release artifacts and unpack them
Verified commands
Executed by our harness on the platforms shown; the assertion checked the actual result, not just the exit code.
Create a .tgz from a directory's contents
tar -czf out.tgz -C project .Common failures (1)
- archive contains a top-level 'project/' folder-C project . archives the contents; 'tar -czf out.tgz project' archives the folder itself
List the files inside a .tgz
tar -tzf archive.tgzExtract a .tgz into a directory
mkdir -p out && tar -xzf archive.tgz -C outCommon failures (1)
- tar: out: Cannot open: No such file or directorythe target directory must exist: mkdir -p out first
Extract a release archive dropping its top-level folder
mkdir -p out && tar -xzf release.tgz --strip-components=1 -C outInstall
Homebrew
brew install gnu-tarapt
sudo apt install tarAgent notes
- When to use
- Packaging build output, unpacking downloaded releases
- Quick examples
tar -czf out.tgz -C dir .tar -xzf archive.tgz -C dest
Use from an agent
curl -s https://clihub.com/api/tools/tar | jq '.agentHints.provenRecipes[] | {task, command, verified}'Or call get_tool with slug tar on the MCP server at https://clihub.com/mcp.