Skip to content

feat: add base64 builtin command #287

@chaliy

Description

@chaliy

Description

Bashkit has no base64 builtin. The base64 command is used in real-world skills.sh scripts for encoding binary data (e.g. subscription GUIDs → base64url for Azure portal URLs).

Reproduction

# Encode string to base64
echo "hello world" | base64
# Error: base64: command not found

# Decode base64
echo "aGVsbG8gd29ybGQ=" | base64 -d
# Error: base64: command not found

# Real-world usage from microsoft-foundry/generate_deployment_url.sh:
GUID_HEX="d5320f9a73da4a74b63983efebc7bb6f"
echo "$GUID_HEX" | xxd -r -p | base64 | tr '+' '-' | tr '/' '_' | tr -d '='
# xxd works, but the pipeline breaks at `base64`

Source: skills.sh leaderboard

Skill: microsoft-foundry from microsoft/github-copilot-for-azure (~57K installs, 17 leaderboard entries)

Script: plugin/skills/microsoft-foundry/models/deploy-model/scripts/generate_deployment_url.sh line 79:

ENCODED_SUB=$(echo "$GUID_HEX" | xxd -r -p | base64 | tr '+' '-' | tr '/' '_' | tr -d '=')

Cross-ref: specs/015-skills-analysis.md — External binaries table lists base64 as MISSING.

Suggested scope

Standard base64 encode/decode:

  • base64 (encode stdin to base64, write to stdout)
  • base64 -d / base64 --decode (decode base64 stdin to binary stdout)
  • base64 -w 0 / base64 --wrap=0 (disable line wrapping — default wraps at 76 chars)

Implementation notes

The base64 crate is already a dependency — used in curl.rs:292-293 for HTTP Basic Auth encoding. The builtin would reuse the same engine (base64::engine::general_purpose::STANDARD). Minimal new code needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions