Skip to content

Commit

Permalink
v1.0.5 main/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
iAkashPattnaik authored Nov 19, 2021
2 parents 54ef0a6 + edcfd61 commit bb664f5
Show file tree
Hide file tree
Showing 12 changed files with 103 additions and 43 deletions.
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
## 1.0.4
## 1.0.5
- Add Secondary Commands
- `ultroid docs`
- `ultroid twitter`
- `ultroid support`
- Fix Heroku Env Error [ #9 ]
- Update Docs for `secondary commands`

## 1.0.4
- Update docs
- Add `heroku` sub-command
- Faster `requirements` installation
- Add heroku sub-command
- Faster requirements installation

## 1.0.3
- Fix `env` bug
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
# <p align="center"><a href="https://github.com/BLUE-DEVIL1134/UltroidCli"><img src="https://github-readme-stats.vercel.app/api/pin?username=BLUE-DEVIL1134&show_icons=true&theme=dracula&hide_border=true&repo=UltroidCli"></a></p>
<p align="center"><a href="https://github.com/BLUE-DEVIL1134/UltroidCli"><img src="https://github-readme-stats.vercel.app/api/pin?username=BLUE-DEVIL1134&show_icons=true&theme=dracula&hide_border=true&repo=UltroidCli"></a></p>
<p align="center">
<a href="https://github.com/BLUE-DEVIL1134/UltroidCli"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FBLUE-DEVIL1134%2FUltroidCli%2F&count_bg=%232100FF&title_bg=%2300BBFF&icon=github.svg&icon_color=%23000000&title=Views&edge_flat=false" /></a>
<img src="https://img.shields.io/badge/Version-1.0.4-blueviolet?&logo=github&style=flat" />
<img src="https://img.shields.io/badge/Version-1.0.5-blueviolet?&logo=github&style=flat" />
</p>

<!-- <h1 align="center" style="color: green;font-weight: bold;">UltroidCli</h1>
<br> -->

Welcome to the [`UltroidCli`](https://github.com/BLUE-DEVIL1134/UltroidCli) project built for [`The Ultroid`](https://github.com/TeamUltroid/Ultroid).
<br>
This Project is actively maintained by [`Akash Pattnaik`](https://github.com/BLUE-DEVIL1134).
<br>
All kinds of contributions are reviewed and accepted.


# What Is `UltroidCli` ?

Well, we all know that `The Ultroid` is currently the best / largest Telegram Userbot Present.

So, as a former developer at `TeamUltroid`, I wanted to do something _out of the box_ to take `Ultroid` to the next level.


# How To Use `UltroidCli` ?

It's simple. Just download the latest build from the `Github Releases` and open a terminal in the download directory.

Now, According to your OS, run the following command:
Expand All @@ -29,30 +26,33 @@ Here, `DownloadPath` is the path where you have downloaded the `UltroidCli` buil
For example -

✔️ `DownloadPath` - `~\Downloads\`
<br>

`DownloadPath` - `~\Downloads\ultroid.exe`

### Windows

```powershell
SET PATH=%PATH%;DownloadPath
```

### Linux

```bash
export PATH=$PATH:/DownloadPath
```

### MacOS

```bash
Well, idk
I am a smol dev, I don't hab MacOS
sudo nano /etc/paths
```
Now, you can run the `UltroidCli` by typing `ultroid` in the terminal.

Now, you can run the `UltroidCli` by typing `ultroid` in the terminal.

# How to build `UltroidCli`
It's super easy. Just clone the repo to a directory, say, `root:ultroid_cli`<br>
Now, in `root:ultroid_cli` do `dart pub get`,<br>
then in `root:ultroid_cli/src` do `pip install -r requirements.txt`.<br>
Make sure you have `PyInstaller` installed!<br><br>
Then, in `root:ultroid_cli` do `dart bin/build.dart`.

Run `root:ultroid_cli/bin/build.dart` for automated build! (Windows Only).

# Contributions

To contribute to this project, just fork it, make commits and make a pull request.
18 changes: 17 additions & 1 deletion bin/ultroid_cli.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// PLease read the GNU Affero General Public License in
// <https://www.github.com/BLUE-DEVIL1134/UltroidCli/blob/main/LICENSE/>.

import 'package:colorize/colorize.dart';
import 'package:ultroid_cli/main.dart';
import 'dart:io';

Expand All @@ -30,7 +31,10 @@ void main(List<String> arguments) async {
'upgrade',
'init',
'delete',
'env'
'env',
'docs',
'support',
'twitter'
]) {
if (!query.toLowerCase().startsWith(i)) {
temp = 'help';
Expand Down Expand Up @@ -78,6 +82,18 @@ void main(List<String> arguments) async {
case 'env':
dotEnvController(arguments);
break;
case 'docs':
urlLauncher('Docs', 'https://ultroid.tech');
break;
case 'support':
urlLauncher('Support', 'https://telegram.dog/TheUltroid');
print("[ ${Colorize('Advice').lightGreen()} ] - Join for latest updates !");
break;
case 'twitter':
urlLauncher('Twitter', 'https://twitter.com/AKASH_AM1');
urlLauncher('Twitter', 'https://twitter.com/TheUltroid');
print("[ ${Colorize('Advice').lightGreen()} ] - Follow for latest updates !");
break;
default:
printHelp();
}
Expand Down
37 changes: 25 additions & 12 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,67 @@
# <p align="center"><a href="https://github.com/BLUE-DEVIL1134/UltroidCli"><img src="https://github-readme-stats.vercel.app/api/pin?username=BLUE-DEVIL1134&show_icons=true&theme=dracula&hide_border=true&repo=UltroidCli"></a></p>
<p align="center"><a href="https://github.com/BLUE-DEVIL1134/UltroidCli"><img src="https://github-readme-stats.vercel.app/api/pin?username=BLUE-DEVIL1134&show_icons=true&theme=dracula&hide_border=true&repo=UltroidCli"></a></p>

<p align="center">
<a href="https://github.com/BLUE-DEVIL1134/UltroidCli"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FBLUE-DEVIL1134%2FUltroidCli%2F&count_bg=%232100FF&title_bg=%2300BBFF&icon=github.svg&icon_color=%23000000&title=Views&edge_flat=false" /></a>
<img src="https://img.shields.io/badge/Version-1.0.4-blueviolet?&logo=github&style=flat" />
<img src="https://img.shields.io/badge/Version-1.0.5-blueviolet?&logo=github&style=flat" />
</p>

# Primary Commands

# Usage
It's really simple to use UltroidCli.

## `ultroid.exe`
When you run just `ultroid.exe` it will show a help menu.
## `ultroid`

When you run just `ultroid` it will show a help menu.
Similar output will come when using with arguments [`'-h'`, `'help'`, `'--help'`].

## `ultorid init`
When you run `ultroid init` it will clone the `ultroid` repository and install all the default dependencies.

When you run `ultroid init` it will clone the `ultroid` repository and install all the default dependencies.

## `ultroid run`
When you run `ultroid run` it will run the `ultroid` if exists wlse will prompt to use `ultroid init` first.

When you run `ultroid run` it will run the `ultroid` if exists wlse will prompt to use `ultroid init` first.

## `ultroid heroku`
Use `ultroid heroku` to run Ultroid on heroku via a Dockerfile.

Use `ultroid heroku` to run Ultroid on heroku via a Dockerfile.

## `ultroid session`
When you run `ultroid session` it spawn a program to generate session string via **CLI**.

When you run `ultroid session` it spawn a program to generate session string via **CLI**.

## `ultroid upgrade`
When you run `ultroid upgrade` it will upgrade the current installation of ultroid to the latest one.

When you run `ultroid upgrade` it will upgrade the current installation of ultroid to the latest one.

## `ultroid version`
When you run `ultroid version` it will print the current `python` , `pip` and `dart` (optional) versions and tell if you are eligible to run ultroid or not.

When you run `ultroid version` it will print the current `python` , `pip` and `dart` (optional) versions and tell if you are eligible to run ultroid or not.

## `ultroid env.<key> <value>`

This is the best command so far.

This will act as a bridge between `root://TeamUltrod/.env` and the cli.

### Various methods -

- `ultroid env.<key> <value>` - Append this set of data to [`root://TeamUltrod/.env`]
- `ultroid env.get all` - Print all the values of [`root://TeamUltrod/.env`]
- `ultroid env.create new` - Create a new [`.env`] file

# Secondary Commands

These are the commands that are meant for help to the user.

- `ultroid docs` - Opens Ultorid Docs
- `ultroid twitter` - Opens Twitter handles
- `ultroid support` - Opens Ultroid Support Group

## Video Example
https://user-images.githubusercontent.com/55914808/129194273-70ad7180-dfeb-4d1d-9de7-3874f09b0b93.mp4

<https://user-images.githubusercontent.com/55914808/129194273-70ad7180-dfeb-4d1d-9de7-3874f09b0b93.mp4>

## Dockerfile Example

[Refer here for `Dockerfle` Example](https://github.com/BLUE-DEVIL1134/UltroidCli/blob/main/docs/Dockerfile)
7 changes: 6 additions & 1 deletion lib/help.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void printHelp() {
' ${Colorize("-h, --help Print this usage information.").cyan()}\n'
' ${Colorize("-v, version Print the required and current Python version.").cyan()}\n'
'\n'
'Available commands:\n'
'Primary Commands:\n'
' ${Colorize("init : ").cyan()}Install Ultroid to root://TeamUltroid.\n'
' ${Colorize("run : ").cyan()}Run Ultroid instantly.\n'
' ${Colorize("heroku : ").cyan()}Run Ultroid for Heroku via Dockerfile.\n'
Expand All @@ -32,6 +32,11 @@ void printHelp() {
' ${Colorize("-v, version : ").cyan()}Print the version of all required dependencies.\n'
' ${Colorize("env.<key> <value>: ").cyan()}Update [ ${Colorize("root://TeamUltroid/.env").green()} ] from cli.\n'
'\n'
'Secondary Commands:\n'
' ${Colorize("docs : ").cyan()}Open Ultroid and Ultroidcli docs.\n'
' ${Colorize("twitter : ").cyan()}Open official Twitter handles.\n'
' ${Colorize("support : ").cyan()}Open Ultroid support telegram group.\n'
'\n'
'[ ${Colorize("Warning").green()} ]\n'
'Run \"${Colorize("ultroid delete").red()}\" only when advised by the devs at \"https://t.me/UltroidSupport, or only if you know what it does !\"\n'
);
Expand Down
7 changes: 2 additions & 5 deletions lib/heroku.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ void runUltroidHeroku() async {
);
exit(1);
}
if (!File('./TeamUltroid/.env').existsSync()) {
print(
Colorize("Please create the file [ ${Colorize('root://TeamUltroid/.env').lightMagenta()} ]")
);
exit(1);
if (File('./TeamUltroid/Dockerfile').existsSync()) {
File('./TeamUltroid/Dockerfile').deleteSync(recursive: true);
}
final filePath = './TeamUltroid/.env';
final dotEnv = DotEnv(filePath: filePath);
Expand Down
2 changes: 1 addition & 1 deletion lib/init.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'dart:io';

import 'package:ultroid_cli/version.dart';

String selfVersion = '1.0.4';
String selfVersion = '1.0.5';

void init() async {
if (Platform.isWindows) {
Expand Down
3 changes: 2 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ export 'package:ultroid_cli/delete.dart';
export 'package:ultroid_cli/env.dart';
export 'package:ultroid_cli/heroku.dart';
export 'package:ultroid_cli/sessionGen.dart';
export 'package:ultroid_cli/url_launcher.dart';


void ultroidCliVersion() async {
try {
var req = await get(
Uri.parse('https://raw.githubusercontent.com/BLUE-DEVIL1134/UltroidCli/main/version.txt'),
);
if (req.body.trim() != '1.0.4') {
if (req.body.trim() != '1.0.5') {
print(
" ${Colorize('╔══════════════════════════════════════════════════════════════════════════╗').cyan()}\n"
" ${Colorize('║').cyan()} A new version of UltroidCli is available! ${Colorize('║').cyan()}\n"
Expand Down
20 changes: 20 additions & 0 deletions lib/url_launcher.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// UltroidCli
// Copyright (C) 2021 Akash Pattnaik
//
// This file is a part of < https://github.com/BLUE-DEVIL1134/UltroidCli/ >
// PLease read the GNU Affero General Public License in
// <https://www.github.com/BLUE-DEVIL1134/UltroidCli/blob/main/LICENSE/>.

import 'package:colorize/colorize.dart';
import 'dart:io';

void urlLauncher(String origin, String url) async {
print('[ ${Colorize(origin).lightGreen()} ] - ${Colorize(url).cyan()}');
if (Platform.operatingSystem == 'linux') {
await Process.run('x-www-browser', [url], runInShell: true);
} else if (Platform.operatingSystem == 'windows') {
await Process.run('start', [url], runInShell: true);
} else if (Platform.operatingSystem == 'macos') {
await Process.run('open', [url], runInShell: true);
}
}
2 changes: 1 addition & 1 deletion lib/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void version() async {
"Dart version • ${dartVersion != '' ? Colorize(dartVersion).cyan() : Colorize('Dart Not Installed').red()}\n"
"Python version • ${pythonVersion != '' ? Colorize(pythonVersion).cyan() : Colorize('Python Not Installed').red()}"
"Pip version • ${pipVersion != '' ? Colorize(pipVersion).cyan() : Colorize('Pip Not Installed').red()}\n"
"UltroidCli version • ${Colorize('1.0.4').cyan()}\n"
"UltroidCli version • ${Colorize('1.0.5').cyan()}\n"
'Platform • ${Colorize(Platform.operatingSystem).cyan()}\n'
'\n'
"This Project is opensource and is maintained by Akash Pattnaik [ ${Colorize('github.com/BLUE-DEVIL1134').lightMagenta()} ]\n"
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ultroid_cli
description: A command-line interface for Ultroid.
version: 1.0.4
version: 1.0.5
icon: icon.ico
lisence: GNU Affero General Public
homepage: https://github.com/BLUE-DEVIL1134/UltroidCli
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.4
1.0.5

0 comments on commit bb664f5

Please sign in to comment.