{"id":18498021,"url":"https://github.com/dream11/odin","last_synced_at":"2025-04-09T00:30:51.138Z","repository":{"id":37095319,"uuid":"414168137","full_name":"dream11/odin","owner":"dream11","description":"Interface for service definitions \u0026 deployments into self-managed environments","archived":false,"fork":false,"pushed_at":"2024-05-22T13:30:33.000Z","size":6119,"stargazers_count":3,"open_issues_count":10,"forks_count":1,"subscribers_count":3,"default_branch":"development","last_synced_at":"2024-05-22T14:42:48.373Z","etag":null,"topics":["deployment","devx","environment","odin","service","versioning"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dream11.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-10-06T10:33:18.000Z","updated_at":"2024-05-29T14:41:31.077Z","dependencies_parsed_at":"2023-11-27T13:29:55.014Z","dependency_job_id":"0c55a013-0db3-46f4-bba1-345d0a16bb75","html_url":"https://github.com/dream11/odin","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dream11%2Fodin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dream11%2Fodin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dream11%2Fodin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dream11%2Fodin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dream11","download_url":"https://codeload.github.com/dream11/odin/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247949713,"owners_count":21023374,"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":["deployment","devx","environment","odin","service","versioning"],"created_at":"2024-11-06T13:37:10.494Z","updated_at":"2025-04-09T00:30:49.418Z","avatar_url":"https://github.com/dream11.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"./docs/odin-logo.jpg\" alt=\"Odin\" title=\"Odin: Internal framework CLI for CRUD operations on environments.\" width=\"30%\" height=\"30%\"\u003e\n\nInterface for service definitions \u0026 deployments into self-managed environments.\n\n## Installation\n\n```shell\nbrew install dream11/tools/odin\n```\n\n\u003e Supporting Darwin(AMD64 \u0026 ARM64) and Linux AMD64\n\n## Development Setup\n\n1. [Download](https://golang.org/dl/go1.17.1.darwin-amd64.pkg) and run the Go installer.\n\n2. Verify Go: `go version`\n\n3. Clone this repo: `git clone https://github.com/dream11/odin`\n\n4. Enter the repository: `cd odin`\n\n5. Install dependencies: `go mod download`\n\n6. Verify the cli: `go run main.go --version`\n\n### Build \u0026 Install\n\n1. Run `make install`\n\nOr,\n\n1. Build the executable: `go build .`\n\n2. Move to binary to system path: `sudo mv ./odin /usr/local/bin`\n\n3. Verify the cli: `odin --version`\n\n## Contribution guide\n\n### Code conventions\n\n1. All variables and functions to be named as per Go's standards (camel case).\n   1. Only the variables \u0026 functions, that are to be used across packages should be named in exported convention `ExportedName`, rest all names should be in unexported convention `unexportedName`.\n   2. All defined command line parameters should follow the following convention - `parameter-name`\n      Example: \n      ```go\n      envType := flagSet.String(\"env-type\", \"kube\", \"environment type to attach with environment\")\n      serviceName := flagSet.String(\"name\", \"\", \"name of service to be used\")\n      ```\n\n2. The project must follow the following [layout](https://github.com/golang-standards/project-layout).\n\n### Formatting the code\n\n1. Install Lint tool: `brew install golangci-lint`\n\n2. Upgrade to its latest version: `brew upgrade golangci-lint`\n\n3. Run linter: `make lint`\n\n\u003e All these linting checks are also ensured in pre-commit checks provided below.\n\n### Making commits\n\n1. Install pre-commit: `pip install pre-commit`\n\n2. Setup pre-commit: `cd odin \u0026\u0026 pre-commit install`\n\n3. Now, make commits.\n\n\u003e Now on every commit that you make, pre-commit hook will validate the `go` code and will suggest changes if any.\n\n### Managing the version\n\nOdin's application version is in the semantic version form i.e. `x.y.z` where, \n`x` is the major version, `y` is the minor version and `z` is the patch version.\n\nThe version is maintained in [odin/app/app.go](./app/app.go) inside variable named `App`.\n\nExample: if the current version is `1.0.0`, then in case of \n\n1. a bug fix or a patch, the patch version is upgraded i.e. `1.0.1`\n2. a minor change in some existing feature, the minor version is upgraded i.e. `1.1.0`\n3. a major feature addition, the major version is upgraded i.e. `2.0.0`\n\n\u003e Update the version responsibly as this version will be used to create a release against any master/main branch merge.\n\n## Commands\n\n### Structure\n\nAll commands are formatted as: odin `\u003cverb\u003e` `\u003cresource\u003e` `\u003coptions\u003e`\n\nHere,\n\n1. `verb` - The action to be performed. Supported verbs are -\n\n    - `create` - For creating/uploading a resource record for future access.\n    - `delete` - For deleting a created resource record.\n    - `update` - For updating \n    - `label` - For attaching a label to a resource.\n    - `list` - For listing all the active entities of that resource.\n    - `describe` - For describing a particular resource.\n    - `status` - For current status of a particular resource\n    - `logs` - For execution logs of resource\n    - `deploy` - For deploying the resource on actual infrastructure.\n    - `destroy` - For destroying a deployed resource.\n\n2. `resource` - The resource on which action will be performed. Example: `env` -\n\n    ```shell\n    odin \u003cverb\u003e environment \u003coptions\u003e\n    ```\n\n3. `options` - Extra properties required to support the commands. Example: `env` -\n\n    ```shell\n    odin \u003cverb\u003e environment --name=demo-1234\n    ```\n\n### [Adding a command](./docs/ADD_COMMAND.md)\n\n### [Hidden commands](./docs/HIDDEN_COMMAND.md)\n\n## Command Line User Interface\n\nTo interact with user via Command Line,\n\n```go\nimport (\n    \"github.com/dream11/odin/internal/ui\"\n)\n```\n\n### Logging\n\n```go\nvar Logger ui.Logger\n\nfunc main() {\n    Logger.Info(\"string\")\n    Logger.Success(\"string\")\n    Logger.Warn(\"string\")\n    Logger.Output(\"string\")\n    Logger.Debug(\"string\")\n    Logger.Error(\"string\") // This should be followed by an exit call\n}\n```\n\n\u003e To enable debug logs, set an environment variable `ODIN_DEBUG=yes` \u0026 unset to disable if already set.\n\n### Inputs\n\n```go\nvar Input ui.Logger\n\nfunc main() {\n    text := Input.Ask(\"Input text\")\n    secretText := Input.AskSecret(\"Input secret text\")\n}\n```\n\n\u003e For using these interfaces(logging \u0026 inputs) within commands, these are available as part of the declared command struct. Follow step 2 [here](./docs/ADD_COMMAND.md).\n\n## Exit status\n\nDefine appropriate exit status for commands based on the success/errors,\n\n| Exit Code | Description |\n| --------- | ----------- |\n| 0 | Exit status 0 denotes that your command ran successfully |\n| 1 | Exit status 1 corresponds to any generic error |\n| 2 | Exit status 2 is a permission denied error |\n| 126 | Exit status 126 is an interesting permissions error code. |\n| 127 | Exit status 127 tells you that one of two things has happened: Either the command doesn't exist, or the command isn't in your path `$PATH` |\n| 128 | Exit status 128 is the response received when an out-of-range exit code is used in programming. |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdream11%2Fodin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdream11%2Fodin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdream11%2Fodin/lists"}