openmacros

Automate Rust scripting workflows with macros for I/O, filesystem, shell, and environment tasks.

12|Updated Apr 21, 2024
One-click install
npx skills add https://github.com/hamdymohamedak/openMacros --skill openmacros
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openmacros
Source: https://github.com/hamdymohamedak/openMacros/tree/main
Command: npx skills add https://github.com/hamdymohamedak/openMacros --skill openmacros

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reduces boilerplate and cognitive load when building Rust automation by providing a macro-based, script-like workflow that covers common I/O, filesystem, env, and shell tasks with explicit error handling.

Core Features & Use Cases

  • Provides core macros for conditional flow, I/O, and string manipulation (say!, cmd!, tpl!, contains!, replace!).
  • Supports optional features for text (regex), async (script_async!, file_read_async!), serde (json_read!, json_write!), and time (now!, today!).
  • Suitable for CLI helpers, glue code, tasks automation, and quick prototypes in Rust projects.

Quick Start

Install the crate and wrap your executable body in script! { ... } to run with AkResult-based error handling.

Frequently Asked Questions about openmacros

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce boilerplate when writing Rust automation scripts?

Rust automation boilerplate is reduced by wrapping executable logic in a script! macro, which handles common I/O, filesystem, and environment tasks while enforcing explicit AkResult-based error handling for your scripts.

Can I use macros for shell commands and file reading in Rust CLI tools?

Yes, macros for shell commands and file reading in Rust CLI tools are provided through core commands like cmd!, alongside optional async features such as file_read_async! for non-blocking filesystem operations.

How do I handle JSON serialization in Rust scripting workflows?

JSON serialization in Rust scripting workflows is handled by enabling the optional serde Cargo feature, which exposes json_read! and json_write! macros to easily parse and serialize data structures.

Does this Rust macro library support async text processing and regex?

Yes, async text processing and regex are supported by enabling optional Cargo features, unlocking the text feature for regex operations and script_async! for asynchronous execution within your Rust scripts.

What is the best way to enforce error handling in Rust glue code?

The best way to enforce error handling in Rust glue code is using a macro-based workflow that mandates AkResult-based error handling, ensuring all I/O and shell operations return explicit errors.

Are there specific macros for time and date operations in Rust automation?

Time and date operations in Rust automation are supported through the optional time Cargo feature, which provides the now! and today! macros for immediate timestamp retrieval in your scripts.