OpenClawSkills
GitHub

Base64 Encoder

Community

Encode or decode strings to/from Base64 format.

Installation

Save as `base64.js`. Usage: `base64 encode <text>` or `base64 decode <text>`.

Source Code

JavaScript
Tutorial.terminal

// base64.js

module.exports = async function(context) {
    const mode = context.args[0]; // 'encode' or 'decode'
    const text = context.args.slice(1).join(' ');
    
    if (mode === 'encode') {
        return Buffer.from(text).toString('base64');
    } else if (mode === 'decode') {
        return Buffer.from(text, 'base64').toString('utf-8');
    } else {
        return "Usage: base64 <encode|decode> <text>";
    }
};

Live Preview

● Live Demo
Agent Session
Starting session...

How to use

  • Ensure you have the necessary dependencies installed (if any).
  • Place the file in your OpenClaw skills folder (e.g., ~/.openclaw/skills/).
  • Restart your agent or reload configuration.
  • Invoke it using the filename (without extension) as the tool name, or through natural language if the description is clear.