Acme-Claude-Shell
view release on metacpan or search on metacpan
lib/Acme/Claude/Shell.pm view on Meta::CPAN
return -t STDOUT ? 1 : 0;
}
=head1 EXAMPLE SESSION
============================================================
Acme::Claude::Shell
============================================================
i AI-powered shell - describe what you want in plain English
i Type 'exit' or 'quit' to leave, 'history' for command log
------------------------------------------------------------
acme_claude_shell> find all perl files larger than 100k
Thinking...
I'll find all .pl files over 100KB and display their sizes:
i Command: find . -name "*.pl" -size +100k -exec ls -lh {} \;
Action:
[a] Approve and run
[d] Dry-run (show only)
[e] Edit command
[x] Cancel
> a
-rw-r--r-- 1 user staff 142K Jan 10 14:23 ./big_script.pl
Done
acme_claude_shell> now compress that file
Thinking...
Based on our previous results, I'll compress:
i Command: gzip ./big_script.pl
Action:
[a] Approve and run
> a
Files compressed successfully
=head1 SDK FEATURES DEMONSTRATED
This module demonstrates every major feature of the Claude::Agent SDK:
=over 4
=item B<query()> - Single-shot mode via C<run()>
=item B<session()> - Multi-turn context via C<shell()>
=item B<SDK MCP Tools> - 6 tools: execute_command, read_file, list_directory, search_files, get_system_info, get_working_directory
=item B<Hooks (PreToolUse)> - Audit logging of tool calls
=item B<Hooks (PostToolUse)> - Stop spinner, track statistics
=item B<Hooks (PostToolUseFailure)> - Graceful error handling
=item B<Hooks (Stop)> - Session statistics on exit
=item B<Hooks (Notification)> - Event logging (verbose mode)
=item B<Dry-run mode> - Preview without executing
=item B<IO::Async> - Non-blocking command execution and spinners
=item B<CLI utilities> - Spinners, menus, colored output
=back
B<Note:> Command approval is handled directly in the execute_command tool
handler to ensure it happens synchronously before execution.
=head1 AUTHOR
LNATION, C<< <email at lnation.org> >>
=head1 SEE ALSO
=over 4
=item * L<Claude::Agent> - The underlying Claude Agent SDK
=item * L<Claude::Agent::CLI> - Terminal UI utilities
=item * L<Acme::Claude::Shell::Session> - Multi-turn session manager
=item * L<Acme::Claude::Shell::Query> - Single-shot query mode
=item * L<Acme::Claude::Shell::Tools> - SDK MCP tool definitions
=item * L<Acme::Claude::Shell::Hooks> - Safety hooks
=back
=head1 LICENSE AND COPYRIGHT
This software is Copyright (c) 2026 by LNATION.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
=cut
1;
( run in 0.601 second using v1.01-cache-2.11-cpan-e1769b4cff6 )