{"id":22203948,"url":"https://github.com/hashibuto/artillery","last_synced_at":"2025-10-13T02:31:34.817Z","repository":{"id":64895061,"uuid":"570734414","full_name":"hashibuto/artillery","owner":"hashibuto","description":"An interactive CLI and command parser for golang","archived":true,"fork":false,"pushed_at":"2024-12-07T21:58:58.000Z","size":1535,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T02:43:58.652Z","etag":null,"topics":["cli","command-line","go","golang","interactive","repl","shell"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashibuto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-26T00:42:31.000Z","updated_at":"2024-12-07T21:59:22.000Z","dependencies_parsed_at":"2024-02-09T23:24:46.093Z","dependency_job_id":"3b3e304a-a010-4c71-9f6e-18b0be8e6cb3","html_url":"https://github.com/hashibuto/artillery","commit_stats":{"total_commits":32,"total_committers":2,"mean_commits":16.0,"dds":0.09375,"last_synced_commit":"be1cbc9636a8c11e3aa7a2154e799fbba3e561b5"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/hashibuto/artillery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashibuto%2Fartillery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashibuto%2Fartillery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashibuto%2Fartillery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashibuto%2Fartillery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashibuto","download_url":"https://codeload.github.com/hashibuto/artillery/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashibuto%2Fartillery/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014022,"owners_count":26085346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","go","golang","interactive","repl","shell"],"created_at":"2024-12-02T17:15:07.191Z","updated_at":"2025-10-13T02:31:34.330Z","avatar_url":"https://github.com/hashibuto.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repository has been archived, please consider the project's successor: https://github.com/hashibuto/commander\n\n# artillery\nAn interactive shell/REPL and CLI parser for golang\n\nArtillery can function both as an interactive shell or REPL, as well as a single command CLI parser.  In interactive mode, it uses [NilShell](https://github.com/hashibuto/nilshell) for the command line editor, completion, and history.\n\n## A basic interactive shell/REPL\n\n```\nimport (\n    \"github.com/hashibuto/artillery\"\n)\n\n\tprocessor := artillery.NewProcessor()\n\n\tcmds := []*artillery.Command{\n\t\t\u0026artillery.Command{\n            Name:        \"hello\",\n            Description: \"prints hello to the console\",\n            Arguments: []*artillery.Argument{\n                {\n                    Name:        \"name\",\n                    Description: \"name of the person to which to say hello\",\n                },\n            },\n            Options: []*artillery.Option{\n                {\n                    Name:        \"shout\",\n                    Description: \"shout mode\",\n                    ShortName:   's',\n                    Type:        artillary.Bool\n                    Value:       true,\n                },\n            },\n            OnExecute: func(ns artillery.Namespace, processor *artillery.Processor) error {\n                var args struct {\n                    Name  string\n                    Shout bool\n                }\n                err := artillery.Reflect(ns, \u0026args)\n                if err != nil {\n                    return err\n                }\n\n                message := fmt.Sprintf(\"hello %s!\", args.Name)\n                if args.Shout {\n                    message = strings.ToUpper(message)\n                }\n                return nil\n            },\n        },\n\t}\n\n\tfor _, c := range cmds {\n\t\terr := processor.AddCommand(c)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}\n\n\tprocessor.Shell().ReadUntilTerm()\n```\n\n## Parse a single CLI command (non-interactive)\n\n```\nimport (\n    \"github.com/hashibuto/artillery\"\n    \"os\"\n)\n\nhelloCmd := \u0026artillery.Command{\n    Name:        \"hello\",\n    Description: \"prints hello to the console\",\n    Arguments: []*artillery.Argument{\n        {\n            Name:        \"name\",\n            Description: \"name of the person to which to say hello\",\n        },\n    },\n    Options: []*artillery.Option{\n        {\n            Name:        \"shout\",\n            Description: \"shout mode\",\n            ShortName:   's',\n            Type:        artillary.Bool\n            Value:       true,\n        },\n    },\n    OnExecute: func(ns artillery.Namespace, processor *artillery.Processor) error {\n        var args struct {\n            Name  string\n            Shout bool\n        }\n        err := artillery.Reflect(ns, \u0026args)\n        if err != nil {\n            return err\n        }\n\n        message := fmt.Sprintf(\"hello %s!\", args.Name)\n        if args.Shout {\n            message = strings.ToUpper(message)\n        }\n        return nil\n    },\n}\n\nprocessor := artillery.NewProcessor()\nprocessor.RemoveBuiltins(false)\nerr := processor.AddCommands(helloCmd)\nif err != nil {\n    panic(err)\n}\n\nerr = processor.Process(os.Args[1:])\n```\n\n## Special commands / keystrokes\n- `clear` clears the terminal\n- `!\u003ccommand\u003e` execs the command ie `!cat /home/user/something` for bash do `!bash -c \"cat /home/user/something | grep whatever\"`\n- `exit` exits\n- `\u003cctrl+r\u003e` reverse search\n- `\u003cup\u003e` move up backwards through the command history\n- `\u003cdown\u003e` move forwards through the command history\n- `\u003cctrl+d\u003e` exit\n- `\u003ctab\u003e` autocomplete\n\n## Example\n[Example showcasing most features](https://github.com/hashibuto/artillery/blob/master/example/main.go)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashibuto%2Fartillery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashibuto%2Fartillery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashibuto%2Fartillery/lists"}