{"id":21915967,"url":"https://github.com/artarts36/singlecli","last_synced_at":"2026-02-22T11:32:48.632Z","repository":{"id":223922352,"uuid":"761910869","full_name":"ArtARTs36/singlecli","owner":"ArtARTs36","description":"package for creating single command console application","archived":false,"fork":false,"pushed_at":"2024-11-20T16:03:14.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-20T17:18:37.485Z","etag":null,"topics":["cli","console","console-application","framework","go"],"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/ArtARTs36.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":"2024-02-22T18:05:57.000Z","updated_at":"2024-11-20T16:03:28.000Z","dependencies_parsed_at":"2024-06-21T13:16:45.161Z","dependency_job_id":"78792bad-6327-487f-b406-379f927f2ab3","html_url":"https://github.com/ArtARTs36/singlecli","commit_stats":null,"previous_names":["artarts36/singlecli"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtARTs36%2Fsinglecli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtARTs36%2Fsinglecli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtARTs36%2Fsinglecli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtARTs36%2Fsinglecli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArtARTs36","download_url":"https://codeload.github.com/ArtARTs36/singlecli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226971307,"owners_count":17711413,"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","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","console","console-application","framework","go"],"created_at":"2024-11-28T19:15:19.410Z","updated_at":"2026-02-22T11:32:48.564Z","avatar_url":"https://github.com/ArtARTs36.png","language":"Go","readme":"# singlecli\n\nsinglecli - package for creating single command console application\n\n## App definition\n\nIt's simple app for adding numbers\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"time\"\n\n\tcli \"github.com/artarts36/singlecli\"\n)\n\nfunc main() {\n\tapplication := cli.App{\n\t\tBuildInfo: \u0026cli.BuildInfo{\n\t\t\tName:      \"number-adder\",\n\t\t\tVersion:   \"0.1.0\",\n\t\t\tBuildDate: time.Now().String(),\n\t\t},\n\t\tAction: run,\n\t\tArgs: []*cli.ArgDefinition{\n\t\t\t{\n\t\t\t\tName:        \"num1\",\n\t\t\t\tDescription: \"first number\",\n\t\t\t\tRequired:    true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:        \"num2\",\n\t\t\t\tDescription: \"second number\",\n\t\t\t\tRequired:    true,\n\t\t\t},\n\t\t},\n\t\tUsageExamples: []*cli.UsageExample{\n\t\t\t{\n\t\t\t\tCommand: \"number-adder 1 and 2\",\n\t\t\t},\n\t\t},\n\t}\n\n\tapplication.RunWithGlobalArgs(context.Background())\n}\n\nfunc run(ctx *cli.Context) error {\n\tnumber1, _ := strconv.Atoi(ctx.GetArg(\"num1\"))\n\tnumber2, _ := strconv.Atoi(ctx.GetArg(\"num2\"))\n\n\tfmt.Printf(\"%d + %d = %d\", number1, number2, number1 + number2)\n\n\treturn nil\n}\n```\n\n## Additional features\n\n### Generate GitHub Action configuration\n\nRun: `go run you_main_file.go --singlecli-codegen-ga`\n\nYou also can generate in pipeline with workflow:\n```yaml\nname: update github action config\n\npermissions: write-all\n\non:\n  push:\n    branches:\n      - master\n\njobs:\n  update-ga-config:\n    runs-on: ubuntu-latest\n    steps:\n      - name: install deps\n        run: sudo apt install gcc\n\n      - name: Check out code\n        uses: actions/checkout@v3\n\n      - name: Set up Go\n        uses: actions/setup-go@v4 # action page: \u003chttps://github.com/actions/setup-go\u003e\n        with:\n          go-version: stable\n\n      - name: Install Go dependencies\n        run: go mod download\n\n      - name: Configure git user\n        run: |\n          git config user.name 'github-actions[bot]'\n          git config user.email 'github-actions[bot]@users.noreply.github.com'\n\n      - name: Hash prev version\n        id: prev_version\n        run: echo \"hash=${{ hashFiles('action.yaml') }}\" \u003e\u003e $GITHUB_OUTPUT\n\n      - name: Generate new config file\n        run: |\n          go run ./cmd/main.go --singlecli-codegen-ga\n\n      - name: Commit changes\n        if: ${{ steps.prev_version.outputs.hash != hashFiles('action.yaml') }}\n        run: |\n          git add action.yaml\n          git commit -m \"chore: actualize ga config\"\n          git push\n```\n\n## Application examples\n* [regexlint - console application for regex validation](https://github.com/ArtARTs36/regexlint)\n* [db-exporter - console application for export db schema and data to formats](https://github.com/ArtARTs36/db-exporter)\n* [gomodchanger - console tool for changing go module path and imports in code files](https://github.com/ArtARTs36/gomodchanger)\n* [telgram-action - action for sending messages to telegram](https://github.com/ArtARTs36/telegram-action)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartarts36%2Fsinglecli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartarts36%2Fsinglecli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartarts36%2Fsinglecli/lists"}