{"id":13397041,"url":"https://github.com/inexio/eve-ng-cli-manager","last_synced_at":"2026-03-09T21:34:50.757Z","repository":{"id":134056114,"uuid":"253786511","full_name":"inexio/eve-ng-cli-manager","owner":"inexio","description":"A tool for using the Eve-NG restAPI via the command line.","archived":false,"fork":false,"pushed_at":"2020-05-25T07:46:31.000Z","size":95,"stargazers_count":14,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-07-31T18:18:59.031Z","etag":null,"topics":["cli","eve-ng","golang"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inexio.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}},"created_at":"2020-04-07T12:29:03.000Z","updated_at":"2022-10-30T10:54:53.000Z","dependencies_parsed_at":"2024-01-15T22:42:49.782Z","dependency_job_id":"54d74576-a112-4fc7-ad8c-db1250d9fcd4","html_url":"https://github.com/inexio/eve-ng-cli-manager","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inexio%2Feve-ng-cli-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inexio%2Feve-ng-cli-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inexio%2Feve-ng-cli-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inexio%2Feve-ng-cli-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inexio","download_url":"https://codeload.github.com/inexio/eve-ng-cli-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243500227,"owners_count":20300760,"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","eve-ng","golang"],"created_at":"2024-07-30T18:01:09.994Z","updated_at":"2026-03-09T21:34:50.734Z","avatar_url":"https://github.com/inexio.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# eve-ng-cli-manager\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/inexio/eve-ng-cli-manger)](https://goreportcard.com/report/github.com/inexio/eve-ng-cli-manger)\n[![GitHub license](https://img.shields.io/badge/license-BSD-blue.svg)](https://github.com/inexio/eve-ng-cli-manger/blob/master/LICENSE)\n[![GitHub code style](https://img.shields.io/badge/code%20style-uber--go-brightgreen)](https://github.com/uber-go/guide/blob/master/style.md)\n\n## Description\n\nA tool for using the [Eve-NG](https://www.eve-ng.net/)  [REST API](https://www.eve-ng.net/index.php/documentation/howtos/how-to-eve-ng-api/) via the command-line written in go using the cobra CLI framework.\n\nThe tool uses our [eve-ng-restapi-go-client](https://github.com/inexio/eve-ng-restapi-go-client).\n\n## Code Style\n\nThis project was written according to the **[uber-go](https://github.com/uber-go/guide/blob/master/style.md)** coding style.\n\n## Features\n\n### Key Eve-NG Feature Support\n\nThis client allows you to create/delete:\n\n- Labs\n- Folders\n- Networks\n- Nodes\n- Users\n\nand also enables you to:\n\n- Move Labs and Folders\n- Edit Labs and Users\n- Get SystemStatus values\n- Start/Stop/Export/Wipe Nodes\n\n## Requirements\n\nRequires a running instance of [Eve-NG](https://www.eve-ng.net/).\n\nTo check if your setup works, follow the steps provided in the **'Tests'** section of this document.\n\n## Installation\n\n```\ngo get github.com/inexio/eve-ng-cli-manager\n```\n\nor\n\n```\ngit clone https://github.com/inexio/eve-ng-cli-manager.git\n```\n\n## Setup\n\nAfter downloading you have to decide wether you use the tool via source or if you want to use its binary.\n\nFor using the tool via source you can run:\n\n```\ngo run eve-ng-cli-manager/eve-ng/main.go  \n```\n\nor you can compile it to a binary:\n\n```\ncd eve-ng-cli-manager/eve-ng\ngo install\ncd $GOBIN\neve-ng\n```\n\nAfter installing the tool you have to either declare a path to your config file or set certain environment variables for the tool to work.\n\nThese can be set as follows:\n\n#### Config File\n\n##### Using source\n\nIn **cmd/root.go**, in the **initConfig()** function you can see the following lines of code:\n\n```\nviper.AddConfigPath(\"config/\")\nviper.SetConfigType(\"yaml\")\nviper.SetConfigName(\"eve-cli-config\")\n```\n\nConfigPath is relative to the package location.\nConfigType and name can also be changed to match your desired type of config.\n\n##### Using the binary\n\nIf you are using the binary you have to add a folder named **config** in the same directory the binary is located at.\n\nIn this **config** folder you have to add a file named **eve-cli-config.yaml**. This file has to contain all data required in the eve-cli config.\n\n##### Using the '--config' flag\n\nIf you want to use an alternative config file for only one command, you can use the --config flag with the command. \n\nHere's an example of this:\n\n```\neve-ng get folders \"/\" --config \"~/go/src/eve-ng-cli-manager/eve-ng/config/configtwo.yaml\"\n```\n\nNote, that this only works for one command and doesn't permanently change the config file.\n\n##### Using the env-var EVE_CLI_CONFIG\n\nYou can also set an environment variable to read in the config file given in that variable.\n\nTo set this variable use:\n\n```\nexport \u003cYOUR_ENV_PREFIX\u003e_CONFIG=/absolut/path/to/your/config\n```\n\nThis way the config will always be read in instead of how '--config' has to be set every time you want to execute a command.\n\n#### Environment Variables\n\nAlso in the **root.go** file, in the **initConfig()** function you will find:\n\n```\n//Set env var prefix to only match certain vars\nviper.SetEnvPrefix(\"EVE_CLI\")\n```\n\n`SetEnvPrefix` can be changed to whatever prefix you prefer to have in your environment vars.\n\nThe needed environment variables can then be added as follows:\n\nFor the management endpoint:\n\n```\nexport EVE_CLI_BASEURL=\"\u003cyour mgmt baseUrl\u003e\"\nexport EVE_CLI_USERNAME=\"\u003cyour username\u003e\"\nexport EVE_CLI_PASSWORD=\"\u003cyour password\u003e\"\n```\n\noptional env-vars:\n\n```\nexport EVE_CLI_LABNAME=\"\u003cname of your desired standard lab\u003e\"\nexport EVE_CLI_LABPATH=\"path to your desired standard lab\"\n```\n\n## Usage\n\nThe following section will show you how to create a lab and do various operations with it.\n\n```go\neve-ng create lab --path \"/\" --name \"TestLab\" --author \"Admin\" --version 1 --description \"A Test Lab\" --body \"A longer version of your description\"\n```\n\nShould return:\n\n```\nSuccessfully created lab.\n```\n\nYou can get information about a component via the get command:\n\n```\neve-ng get lab \"/TestLab\"\n```\n\nWhich should return:\n\n```\nLab\n  Id: a486aa2d-6036-4f3a-9162-82050d80e1ec\n  Name: TestLab\n  Version: 1\n  Author: admin\n  Body: A longer version of your description\n  Description: A Test Lab\n  Filename: TestLab.unl\n```\n\nTo add a network use the create command:\n\n```\neve-ng create network --name \"TestNet\" --left 10 --top 10 --type nat0 --lab \"/TestLab\"\n```\n\nWhich should return:\n\n```\nSuccessfully added network to lab.\nID: 1\n```\n\nTo retreive data about the network you just created use the get command once again:\n\n```\neve-ng get network 1 --lab \"/TestLab\"\n```\n\n Which will return:\n\n```\nNetwork\n  Name: TestNet\n  Type: nat0\n  Top: 10\n  Left: 10\n  Style: Solid\n  Linkstyle: Straight\n  Color:\n  Label:\n  Visibility: 1\n```\n\nNow you can create a node using:\n\n```\neve-ng create node --name TestNode --ram 512 --top 100 --left 100 --icon Router.png --image \"asav-952-204\" --template asav --type qemu --lab \"/TestLab\"\n```\n\nWhich returns:\n\n```\nSuccessfully added node to lab.\nID: 1\n```\n\nYou can now once again use the get command to retreive information about the node:\n\n```\neve-ng get node 1 --lab \"/TestLab\"\n```\n\nThis will return:\n\n```\nNode\n  Uuid: 93af4a9d-a7ac-4514-879d-a36738f52a0d\n  Name: TestNode\n  Type: qemu\n  Status: 0\n  Template: asav\n  Cpu: 1\n  Ram: 512\n  Image: asav-952-204\n  Console: telnet\n  Ethernet: 4\n  Delay: 0\n  Icon: AristaSW.png\n  Url: html5/#/client/unknowntoken\n  Top: 100\n  Left: 100\n  Config: 0\n  Firstmac: 50:04:00:01:00:00\n  Configlist:\n```\n\n![eve_ng_tutorial_x2](https://user-images.githubusercontent.com/55132811/82790504-71230b00-9e6c-11ea-8492-a1c7f4ba5ccd.gif)\n\n\n## Tests\n\nIn order to test if your setup is operational you can use the following command:\n\n```\ngo run main.go get lab-files \"/\"\n```\n\nor\n\n```\neve-ng get lab-files \"/\"\n```\n\nThe output should be a list of all laboratory files located in the root location:\n\n```\nLabFiles(0)\n    /\n```\n\nor if you have any labs configured it should look like this:\n\n```\nLabFiles(2) \n\n  LabFile\n    File: TestLab.unl\n    Path: ///TestLab.unl\n\n  LabFile\n    File: TestLab2.unl\n    Path: ///TestLab2.unl\n```\n\n## Getting Help\n\nIf there are any problems or something does not work as intended, open an [issue](https://github.com/inexio/eve-ng-cli-manager/issues/new/choose) on GitHub.\n\nIf you have problems with the usage of the application itself you can use the built in **--help** flag to get some useful information about every command.\n\n![eve_ng_help](https://user-images.githubusercontent.com/55132811/82790074-b8f56280-9e6b-11ea-82f6-02bf388d0cbb.gif)\n\n## Contribution\n\nContributions to the project are welcome.\n\nWe are looking forward to your bug reports, suggestions and fixes.\n\nIf you want to make any contributions make sure your go report does match up with our projects score of **A+**.\n\nWhen you contribute make sure your code is conform to the **uber-go** coding style.\n\nHappy Coding!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finexio%2Feve-ng-cli-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finexio%2Feve-ng-cli-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finexio%2Feve-ng-cli-manager/lists"}