Skip to content

Commit 09ba21b

Browse files
committed
Add examples [ci skip]
1 parent 76912a7 commit 09ba21b

1 file changed

Lines changed: 105 additions & 2 deletions

File tree

README.md

Lines changed: 105 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,26 @@
77

88
Be a rockstar and efficiently manage your team's gitlab.org or [self-hosted Gitlab](https://about.gitlab.com/installation/) projects, groups, users and other resources.
99

10+
Tested on __Gitlab 10.7.4__
11+
1012
## Getting Started
1113

12-
Please see [Github site](https://devopsctl.github.io/gitlabctl/) for a nice documentation of this project.
14+
Please see [Commands Manual](https://devopsctl.github.io/gitlabctl/) for a nice documentation of this project.
1315

1416
## Installing
1517

16-
Download the binary from [releases](https://github.com/devopsctl/gitlabctl/releases) or use Go Get, `go get github.com/devopsctl/gitlabctl`.
18+
Get the download link of your preferred platform binary from [RELEASES](https://github.com/devopsctl/gitlabctl/releases) and ensure that it is downloaded in one of your `$PATH` directories.
19+
20+
```bash
21+
# This is an example manual installation
22+
wget https://github.com/devopsctl/gitlabctl/releases/download/v0.0.1/gitlabctl-darwin-amd64
23+
mv gitlabctl-darwin-amd64 /usr/local/bin/gitlabctl && chmod +x /usr/local/bin/gitlabctl
24+
25+
# Test the command
26+
gitlabctl --version
27+
```
28+
29+
For __Golang__ developers, you can get the latest binary using `go get github.com/devopsctl/gitlabctl`.
1730

1831
Enable auto complete for __bash__ or __zsh__ shell. ❤️
1932

@@ -22,6 +35,96 @@ Enable auto complete for __bash__ or __zsh__ shell. ❤️
2235
gitlabctl completion -h
2336
```
2437

38+
## Quickstart
39+
40+
### Using the help commands
41+
42+
```bash
43+
# get commands is used to list resources
44+
gitlabctl get [subcommand] -h
45+
46+
# new commands is used to create a single resource
47+
gitlabctl new [subcommand] -h
48+
49+
# edit commands is used to update a single resource
50+
gitlabctl edit [subcommand] -h
51+
52+
# delete commands is used to delete a single resource
53+
gitlabctl delete [subcommand] -h
54+
55+
# describe command is used to describe a single resource
56+
gitlabctl describe [subcommand] -h
57+
```
58+
59+
### Usage Examples
60+
61+
Fetching resources with using `--output, -o` formatter flag.
62+
63+
```bash
64+
>> gitlabctl get groups
65+
+----+------------------+------------------------------------------------+-----------+
66+
| ID | PATH | URL | PARENT ID |
67+
+----+------------------+------------------------------------------------+-----------+
68+
| 13 | Group1 | http://localhost:10080/groups/Group1 | 0 |
69+
| 14 | Group2 | http://localhost:10080/groups/Group2 | 0 |
70+
| 16 | Group1/SubGroup2 | http://localhost:10080/groups/Group1/SubGroup2 | 13 |
71+
| 15 | Group1/SubGroup1 | http://localhost:10080/groups/Group1/SubGroup1 | 13 |
72+
| 17 | Group2/SubGroup3 | http://localhost:10080/groups/Group2/SubGroup3 | 14 |
73+
| 18 | Group2/SubGroup4 | http://localhost:10080/groups/Group2/SubGroup4 | 14 |
74+
+----+------------------+------------------------------------------------+-----------+
75+
```
76+
77+
```bash
78+
>> gitlabctl get groups -o json
79+
[
80+
{
81+
"id": 13,
82+
"name": "Group1",
83+
"path": "Group1",
84+
"description": "Updated by go test by id",
85+
"visibility": "private",
86+
"lfs_enabled": false,
87+
"avatar_url": "",
88+
"web_url": "http://localhost:10080/groups/Group1",
89+
"request_access_enabled": false,
90+
"full_name": "Group1",
91+
"full_path": "Group1",
92+
"parent_id": 0,
93+
"projects": null,
94+
"statistics": null
95+
},
96+
{
97+
"id": 14,
98+
"name": "Group2",
99+
"path": "Group2",
100+
"description": "",
101+
"visibility": "private",
102+
"lfs_enabled": true,
103+
"avatar_url": "",
104+
"web_url": "http://localhost:10080/groups/Group2",
105+
"request_access_enabled": false,
106+
"full_name": "Group2",
107+
"full_path": "Group2",
108+
"parent_id": 0,
109+
"projects": null,
110+
"statistics": null
111+
},
112+
]
113+
```
114+
115+
Creating resources.
116+
117+
```bash
118+
# create a group
119+
>> gitlabctl new group devopsctl
120+
121+
# create a project under devopsctl group
122+
>> gitlabctl new project gitlab-cli --namespace=devopsctl
123+
124+
# create a new user with username john
125+
>> gitlabctl new user john --name="John Smith" --password="john123456" --email=john@example.com --reset-password
126+
```
127+
25128
## Contributing
26129

27130
Contributors are welcomed with love! Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for the process for submitting pull requests to us.

0 commit comments

Comments
 (0)