From 67855a6be72fa4aa18a57d67a2a9705be290a420 Mon Sep 17 00:00:00 2001 From: Akash Pattnaik Date: Fri, 19 Nov 2021 15:42:27 +0530 Subject: [PATCH 1/8] fix heroku env error --- lib/heroku.dart | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/heroku.dart b/lib/heroku.dart index 21bf692..e6a1f37 100644 --- a/lib/heroku.dart +++ b/lib/heroku.dart @@ -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); From b17a7b14b6a67bbc3143ae13166606b2d5beb654 Mon Sep 17 00:00:00 2001 From: Akash Pattnaik Date: Fri, 19 Nov 2021 16:13:55 +0530 Subject: [PATCH 2/8] add secondary commands --- bin/ultroid_cli.dart | 18 +++++++++++++++++- lib/help.dart | 7 ++++++- lib/main.dart | 1 + lib/url_launcher.dart | 20 ++++++++++++++++++++ 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 lib/url_launcher.dart diff --git a/bin/ultroid_cli.dart b/bin/ultroid_cli.dart index b6e78a3..910abd7 100644 --- a/bin/ultroid_cli.dart +++ b/bin/ultroid_cli.dart @@ -5,6 +5,7 @@ // PLease read the GNU Affero General Public License in // . +import 'package:colorize/colorize.dart'; import 'package:ultroid_cli/main.dart'; import 'dart:io'; @@ -30,7 +31,10 @@ void main(List arguments) async { 'upgrade', 'init', 'delete', - 'env' + 'env', + 'docs', + 'support', + 'twitter' ]) { if (!query.toLowerCase().startsWith(i)) { temp = 'help'; @@ -78,6 +82,18 @@ void main(List 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(); } diff --git a/lib/help.dart b/lib/help.dart index 9dad827..ea6c0b0 100644 --- a/lib/help.dart +++ b/lib/help.dart @@ -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' @@ -32,6 +32,11 @@ void printHelp() { ' ${Colorize("-v, version : ").cyan()}Print the version of all required dependencies.\n' ' ${Colorize("env. : ").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' ); diff --git a/lib/main.dart b/lib/main.dart index b08750e..8d61923 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -20,6 +20,7 @@ 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 { diff --git a/lib/url_launcher.dart b/lib/url_launcher.dart new file mode 100644 index 0000000..368ee85 --- /dev/null +++ b/lib/url_launcher.dart @@ -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 +// . + +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); + } +} \ No newline at end of file From 9cd956bd9fa73db7d5aa7c0a4c911430266fd5c7 Mon Sep 17 00:00:00 2001 From: Akash Pattnaik Date: Fri, 19 Nov 2021 16:16:34 +0530 Subject: [PATCH 3/8] update version --- lib/init.dart | 2 +- lib/main.dart | 2 +- lib/version.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/init.dart b/lib/init.dart index 01b2c01..69a1db2 100644 --- a/lib/init.dart +++ b/lib/init.dart @@ -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) { diff --git a/lib/main.dart b/lib/main.dart index 8d61923..d9bcb00 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -28,7 +28,7 @@ void ultroidCliVersion() async { 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" diff --git a/lib/version.dart b/lib/version.dart index 8de9c6e..d9c3df7 100644 --- a/lib/version.dart +++ b/lib/version.dart @@ -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" From f55ee3b8d67ac8207586186be1916ddb2931da87 Mon Sep 17 00:00:00 2001 From: Akash Pattnaik Date: Fri, 19 Nov 2021 16:30:01 +0530 Subject: [PATCH 4/8] update docs --- README.md | 32 ++++++++++++++++---------------- docs/README.md | 37 +++++++++++++++++++++++++------------ 2 files changed, 41 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index f8888e0..e958450 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,23 @@ -#

+

- +

- - Welcome to the [`UltroidCli`](https://github.com/BLUE-DEVIL1134/UltroidCli) project built for [`The Ultroid`](https://github.com/TeamUltroid/Ultroid).
This Project is actively maintained by [`Akash Pattnaik`](https://github.com/BLUE-DEVIL1134).
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: @@ -29,30 +26,33 @@ Here, `DownloadPath` is the path where you have downloaded the `UltroidCli` buil For example - ✔️ `DownloadPath` - `~\Downloads\` -
+ ❌ `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`
-Now, in `root:ultroid_cli` do `dart pub get`,
-then in `root:ultroid_cli/src` do `pip install -r requirements.txt`.
-Make sure you have `PyInstaller` installed!

-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. diff --git a/docs/README.md b/docs/README.md index 21c546e..9ab148e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,54 +1,67 @@ -#

+

+

- +

+# 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. ` + This is the best command so far. This will act as a bridge between `root://TeamUltrod/.env` and the cli. ### Various methods - + - `ultroid env. ` - 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 + + ## Dockerfile Example + [Refer here for `Dockerfle` Example](https://github.com/BLUE-DEVIL1134/UltroidCli/blob/main/docs/Dockerfile) From a3dd055c84d7a124a494f32b52b4c97565801488 Mon Sep 17 00:00:00 2001 From: Akash Pattnaik Date: Fri, 19 Nov 2021 16:30:15 +0530 Subject: [PATCH 5/8] update version --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index a6a3a43..1464c52 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.4 \ No newline at end of file +1.0.5 \ No newline at end of file From 452821bd5ca24bc79f1b1fcc36f62fc81695f517 Mon Sep 17 00:00:00 2001 From: AkashPattanaik Date: Fri, 19 Nov 2021 16:34:39 +0530 Subject: [PATCH 6/8] update version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 01682f7..9e42829 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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 From 6d6912a7ede095bae0d8fc180c53b303579b4244 Mon Sep 17 00:00:00 2001 From: AkashPattanaik Date: Fri, 19 Nov 2021 16:36:34 +0530 Subject: [PATCH 7/8] Update CHANGELOG.md --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb63df0..bdce2be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## 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 for `heroku` command + - Add heroku sub-command + - Faster requirements installation + ## 1.0.3 - Fix `env` bug - Update docs for `env` From 49828ff7b4d2b0b4be90eba969a1b67cd69e10b3 Mon Sep 17 00:00:00 2001 From: AkashPattanaik Date: Fri, 19 Nov 2021 16:38:25 +0530 Subject: [PATCH 8/8] lol --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdce2be..e7902a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ - Update Docs for `secondary commands` ## 1.0.4 - - Update docs for `heroku` command + - Update docs - Add heroku sub-command - Faster requirements installation