Skip to content

Commit bbcabfe

Browse files
authored
Update README.md
1 parent 13b9e93 commit bbcabfe

File tree

1 file changed

+131
-69
lines changed

1 file changed

+131
-69
lines changed

README.md

+131-69
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,181 @@
1-
# Cirun Python Client and CLI
1+
# cirun-py
22

3-
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/cirun.svg)](https://anaconda.org/conda-forge/cirun) [![PyPI - Version](https://img.shields.io/pypi/v/cirun.svg)](https://pypi.org/project/cirun)
4-
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/cirun.svg)](https://pypi.org/project/cirun) [![Conda Recipe](https://img.shields.io/badge/recipe-cirun-green.svg)](https://anaconda.org/conda-forge/cirun)
3+
<div align="center">
4+
<picture>
5+
<source media="(prefers-color-scheme: dark)" alt="Cirun logo" height="150" srcset="https://raw.githubusercontent.com/AktechLabs/cirun-docs/refs/heads/main/static/img/cirun-logo-dark.svg">
6+
<source media="(prefers-color-scheme: light)" alt="Cirun logo" height="150" srcset="https://raw.githubusercontent.com/AktechLabs/cirun-docs/refs/heads/main/static/img/cirun-logo-light.svg">
7+
<img alt="Cirun logo" height="150" src="https://raw.githubusercontent.com/AktechLabs/cirun-docs/refs/heads/main/static/img/cirun-logo-light.svg">
8+
</picture>
59

6-
-----
10+
<h3>Python Client and CLI for the Cirun Platform</h3>
711

8-
**Table of Contents**
12+
[![PyPI - Version](https://img.shields.io/pypi/v/cirun.svg?style=for-the-badge&logo=pypi&logoColor=white)](https://pypi.org/project/cirun)
13+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/cirun.svg?style=for-the-badge&logo=python&logoColor=white)](https://pypi.org/project/cirun)
14+
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/cirun.svg?style=for-the-badge&logo=anaconda&logoColor=white)](https://anaconda.org/conda-forge/cirun)
15+
[![Conda Recipe](https://img.shields.io/badge/recipe-cirun-green.svg?style=for-the-badge&logo=conda-forge&logoColor=white)](https://anaconda.org/conda-forge/cirun)
16+
[![License](https://img.shields.io/badge/license-MIT-%23yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
17+
[![Documentation](https://img.shields.io/badge/docs-cirun-%230075A8.svg?style=for-the-badge)](https://docs.cirun.io)
18+
</div>
919

10-
- [Installation](#installation)
11-
- [Usage](#usage)
12-
- [License](#license)
20+
## 🚀 Overview
1321

14-
## Installation
22+
**cirun-py** is a Python client and command-line interface for the [Cirun platform](https://cirun.io), enabling seamless management of your CI/CD infrastructure. Whether you're managing repositories, or connecting cloud providers, cirun-py makes it simple with both a programmatic API and intuitive CLI.
1523

16-
```console
24+
## ✨ Features
25+
26+
- **Dual Interface**: Use as both a Python client library and CLI tool
27+
- **Repository Management**: Easily activate, deactivate, and list repositories
28+
- **Cloud Provider Integration**: Connect AWS, Azure, GCP, and other cloud providers
29+
- **Elegant API**: Clean, Pythonic interface for all Cirun operations
30+
- **Rich Output Formatting**: Beautiful CLI output for better readability
31+
32+
## 📦 Installation
33+
34+
### Using pip (Recommended)
35+
36+
```bash
1737
pip install cirun
1838
```
1939

20-
or via `conda-forge`
40+
### Using conda
2141

22-
```console
42+
```bash
2343
conda install -c conda-forge cirun
2444
```
2545

26-
## Usage
46+
### From Source
2747

28-
**cirun-py** can be used as a CLI as well as a Python client programmatically.
48+
```bash
49+
git clone https://github.com/cirun-io/cirun-py
50+
cd cirun-py
51+
pip install -e .
52+
```
2953

30-
- Create an API key from the Cirun Dashboard https://cirun.io/admin/api
31-
- Set that API Key as an environment variable named `CIRUN_API_KEY`
54+
## 🏃‍♂️ Quick Start
3255

33-
```console
56+
1. **Get your API key** from the [Cirun dashboard](https://cirun.io/admin/api)
57+
2. **Set your API key as an environment variable**:
58+
59+
```bash
3460
export CIRUN_API_KEY=<your-api-key>
3561
```
3662

37-
### CLI
63+
3. **Start using cirun-py!**
3864

39-
- List active repositories for Cirun
65+
## 🧰 Usage
4066

41-
```bash
42-
$ cirun repo list
43-
──────────────────────────────────────────────────────────────────────────────────────────────────────────
44-
{
45-
"repos": [
46-
{
47-
"repository": "aktech/cirun-openstack-example",
48-
"active": true,
49-
"private": false
50-
},
51-
{
52-
"repository": "aktechlabs/cirun-demo",
53-
"active": true,
54-
"private": true
55-
}
56-
]
57-
}
58-
──────────────────────────────────────────────────────────────────────────────────────────────────────────
59-
```
67+
### CLI Examples
6068

61-
- Active (add) a repository
69+
#### Repository Management
6270

6371
```bash
64-
$ cirun repo add aktech/sympy
65-
──────────────────────────────────────────────────────────────────────────────────────────────────────────
66-
{
67-
"name": "aktech/sympy",
68-
"active": true
69-
}
70-
──────────────────────────────────────────────────────────────────────────────────────────────────────────
71-
```
72+
# List active repositories
73+
cirun repo list
7274

73-
- Deactivate (remove) a repository
75+
# Activate a repository
76+
cirun repo add username/repo-name
7477

75-
```bash
76-
$ cirun repo remove aktech/sympy
77-
──────────────────────────────────────────────────────────────────────────────────────────────────────────
78-
{
79-
"name": "aktech/sympy",
80-
"active": false
81-
}
82-
──────────────────────────────────────────────────────────────────────────────────────────────────────────
78+
# Deactivate a repository
79+
cirun repo remove username/repo-name
8380
```
8481

85-
- Connect cloud provider with Cirun
82+
#### Cloud Provider Integration
8683

8784
```bash
85+
# Connect AWS
8886
cirun cloud connect aws --access-key AKIXXXXXXXXX --secret-key KFCF3yi+df0n12345678AMASDFGHJ
8987

88+
# Connect Azure
9089
cirun cloud connect azure \
9190
--subscription-id 31184337-0346-4782-ae59-eb185fd0cfa1 \
9291
--tenant-id a66e466d-698b-4a91-b9e3-949f9cc04f11 \
9392
--client-id 340d01fc-ba24-43ee-844e-d364899d29e7 \
9493
--client-secret KFCF3yi+df0cirunIsAwesomeIsntIt?n1DFGHJ
9594

95+
# Connect GCP
9696
cirun cloud connect gcp --key-file /path/to/service-account-key.json
9797
```
9898

99-
### Client
99+
### Python Client Examples
100100

101101
```python
102102
from cirun import Cirun
103-
# Create cirun client object
104-
# Pass the token or set `CIRUN_API_KEY` environment variable
105-
c = Cirun(token='cirun-4cabcdbf-275c-4500-890d-712340663ddc')
106103

107-
# List repositories
108-
c.get_repos()
104+
# Initialize client (pass token or set CIRUN_API_KEY environment variable)
105+
cirun_client = Cirun(token='cirun-4cabcdbf-275c-4500-890d-712340663ddc')
106+
107+
# List all repositories
108+
repos = cirun_client.get_repos()
109+
print(repos)
109110

110-
# Active (add) a repository
111-
c.set_repo('aktech/sympy', active=True)
111+
# Activate a repository
112+
cirun_client.set_repo('username/repo-name', active=True)
112113

113-
# Deactivate (remove) a repository
114-
c.set_repo('aktech/sympy', active=False)
114+
# Deactivate a repository
115+
cirun_client.set_repo('username/repo-name', active=False)
116+
117+
# Connect cloud provider
118+
cirun_client.connect_aws(
119+
access_key='AKIXXXXXXXXX',
120+
secret_key='KFCF3yi+df0n12345678AMASDFGHJ'
121+
)
115122
```
116123

117-
## License
124+
## ⚙️ Configuration
125+
126+
### Environment Variables
127+
128+
| Variable | Description | Default |
129+
|----------|-------------|---------|
130+
| `CIRUN_API_KEY` | API key for authentication | (Required) |
131+
| `CIRUN_API_URL` | Base URL for Cirun API | https://api.cirun.io/api/v1 |
132+
133+
## 📚 Documentation
134+
135+
For comprehensive documentation, visit:
136+
- [Cirun Documentation](https://docs.cirun.io/)
137+
- [Python Client API Reference](https://docs.cirun.io/python)
138+
- [CLI Command Reference](https://docs.cirun.io/cli)
139+
140+
## 🔍 Troubleshooting
141+
142+
### Common Issues
143+
144+
- **Authentication Errors**: Ensure your API key is correctly set
145+
- **Connection Issues**: Check your network connection to api.cirun.io
146+
- **Permission Problems**: Verify you have the required permissions for the operation
147+
148+
### Debug Mode
149+
150+
For detailed logs:
151+
152+
```bash
153+
cirun --debug repo list
154+
```
155+
156+
## 💬 Support
157+
158+
Get help from our team and community:
159+
160+
- **Slack**: [Join our community](https://slack.cirun.io/)
161+
- **Email**: [email protected]
162+
- **GitHub Issues**: [Report bugs](https://github.com/cirun-io/cirun-py/issues)
163+
164+
## 📜 License
165+
166+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
167+
168+
## 🤝 Contributing
169+
170+
We welcome contributions! Here's how:
171+
172+
1. Fork the repository
173+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
174+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
175+
4. Push to the branch (`git push origin feature/amazing-feature`)
176+
5. Open a Pull Request
177+
178+
## 🔄 Related Projects
118179

119-
`cirun` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
180+
- [cirun-agent](https://github.com/cirun-io/cirun-agent): Rust agent for on-premise runner provisioning
181+
- [cirun-docs](https://github.com/cirun-io/cirun-docs): Documentation for the Cirun platform

0 commit comments

Comments
 (0)