-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ec883de
Showing
15 changed files
with
1,096 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Files and directories created by pub. | ||
.dart_tool/ | ||
.packages | ||
|
||
# Conventional directory for build output. | ||
build/ | ||
|
||
# Cuntom files and directories | ||
pubspec.lock | ||
bin/ultroid_cli.exe |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<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 allknow 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: | ||
|
||
Here, `DownloadPath` is the path where you have downloaded the `UltroidCli` build. | ||
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 | ||
``` | ||
Now, you can run the `UltroidCli` by typing `ultroid` in the terminal. | ||
# Contributions | ||
To contribute to this project, just fork it, make commits and make a pull request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Defines a default set of lint rules enforced for projects at Google. For | ||
# details and rationale, see | ||
# https://github.com/dart-lang/pedantic#enabled-lints. | ||
|
||
include: package:pedantic/analysis_options.yaml | ||
|
||
# For lint rules and documentation, see http://dart-lang.github.io/linter/lints. | ||
|
||
# Uncomment to specify additional rules. | ||
# linter: | ||
# rules: | ||
# - camel_case_types | ||
|
||
# analyzer: | ||
# exclude: | ||
# - path/to/excluded/files/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// 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:ultroid_cli/main.dart'; | ||
import 'dart:io'; | ||
|
||
void main(List<String> arguments) async { | ||
stdout.write('\x1B[2J\x1B[0;0H'); | ||
ultroidCliVersion(); | ||
var query = 'help'; | ||
var temp = 'help'; | ||
try { | ||
query = arguments[0].toLowerCase(); | ||
} catch (error) { | ||
query = 'help'; | ||
} | ||
for (var i in ['help', '-h', '--help', '-v', 'version', 'run', 'upgrade', 'init', 'delete']) { | ||
if (i != query.toLowerCase()) { | ||
temp = 'help'; | ||
} else { | ||
temp = i; | ||
break; | ||
} | ||
} | ||
query = temp; | ||
|
||
switch (query) { | ||
case '--help': | ||
printHelp(); | ||
break; | ||
case '-h': | ||
printHelp(); | ||
break; | ||
case 'help': | ||
printHelp(); | ||
break; | ||
case 'version': | ||
version(); | ||
break; | ||
case '-v': | ||
version(); | ||
break; | ||
case 'init': | ||
init(); | ||
break; | ||
case 'upgrade': | ||
upgradeUltoid(); | ||
break; | ||
case 'run': | ||
runUltroid(); | ||
break; | ||
case 'delete': | ||
deleteUltroid(); | ||
break; | ||
default: | ||
printHelp(); | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// 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'; | ||
|
||
// Ultroid | ||
import 'package:ultroid_cli/version.dart'; | ||
|
||
void deleteUltroid() async { | ||
final rootDirectory = Directory('./TeamUltroid'); | ||
if (!rootDirectory.existsSync()) { | ||
print(Colorize('Ultroid at [ ${Colorize("root://TeamUltroid").lightMagenta()} ] dosen\'t exists !').cyan()); | ||
} else { | ||
print(Colorize('Removing Ultroid at [ ${Colorize("root://TeamUltroid").lightMagenta()} ]').cyan()); | ||
rootDirectory.deleteSync(recursive: true); | ||
print(Colorize('Succesfully Removed Ultroid at [ ${Colorize("root://TeamUltroid").lightMagenta()} ]').cyan()); | ||
} | ||
version(); | ||
print(Colorize('To Install Ultroid, Use The Command [ ultroid init ]').lightGreen()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// 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'; | ||
|
||
void printHelp() { | ||
print( | ||
'Manage Ultroid with UltroidCli\n' | ||
'\n' | ||
'Common commands:\n' | ||
' ${Colorize("ultroid run").cyan()}\n' | ||
' Run Ultroid Instantly.\n' | ||
' ${Colorize("ultroid upgrade").cyan()}\n' | ||
' Upgrade Ultroid Without Starting It.\n' | ||
'\n' | ||
'Usage: ironeye <command> [optional-arguments]\n' | ||
'Global options:\n' | ||
' ${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' | ||
' ${Colorize("init : ").cyan()}Install Ultroid To root://TeamUltroid.\n' | ||
' ${Colorize("run : ").cyan()}Run Ultroid instantly.\n' | ||
' ${Colorize("upgrade : ").cyan()}Upgrade Ultroid to latest version.\n' | ||
' ${Colorize("-h, help : ").cyan()}Print this usage information.\n' | ||
' ${Colorize("-v, version: ").cyan()}Print the version of all required dependencies.\n' | ||
'\n' | ||
'[ ${Colorize("Warning").green()} ]\n' | ||
'Run \"${Colorize("ultroid delete").red()}\" only when advised by \"t.me/xditya\"\n' | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import 'package:colorize/colorize.dart'; | ||
import 'dart:io'; | ||
|
||
// Ultroid | ||
import 'package:ultroid_cli/version.dart'; | ||
// 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/>. | ||
|
||
void init() async { | ||
final rootDirectory = Directory('./TeamUltroid'); | ||
if (!rootDirectory.existsSync()) { | ||
print(Colorize('Installing Ultroid to [ ${Colorize("root://TeamUltroid").lightMagenta()} ]').cyan()); | ||
await Process.run('git', ['clone', 'https://github.com/TeamUltroid/Ultroid', 'TeamUltroid'], runInShell: true); | ||
print( | ||
"${Colorize('Successfully Installed Ultroid to [ ').cyan()}" | ||
"${Colorize('root://TeamUltroid/').lightMagenta()}" | ||
"${Colorize(' ]').cyan()}" | ||
); | ||
print( | ||
"${Colorize('Installing Ultroid Dependencies [ ').cyan()}" | ||
"${Colorize('root://TeamUltroid/requirements.txt').lightMagenta()}" | ||
"${Colorize(' ]').cyan()}" | ||
); | ||
await Process.run( | ||
'pip', ['install', '-r', '-U', 'requirements.txt'], | ||
runInShell: true, | ||
workingDirectory: rootDirectory.absolute.uri.toFilePath() | ||
); | ||
for (var eachRequirement in [ | ||
'fonttools', | ||
'covid', | ||
'gtts', | ||
'pokedex.py', | ||
'pyshorteners', | ||
'pyfiglet', | ||
'pyjokes', | ||
'quotefancy', | ||
'wikipedia', | ||
'textblob', | ||
'lyrics_extractor==3.0.1', | ||
]) { | ||
await Process.run( | ||
'pip', ['install', '-U', eachRequirement], | ||
runInShell: true, | ||
workingDirectory: rootDirectory.absolute.uri.toFilePath() | ||
); | ||
} | ||
print( | ||
"${Colorize('Successfully Installed Ultroid Dependencies [ ').cyan()}" | ||
"${Colorize('root://TeamUltroid/requirements.txt').lightMagenta()}" | ||
"${Colorize(' ]').cyan()}" | ||
); | ||
} | ||
version(); | ||
print(Colorize('To Run Ultroid, Use The Command [ ultroid run ]').lightGreen()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// 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/>. | ||
|
||
library ultroid_cli; | ||
|
||
import 'package:colorize/colorize.dart'; | ||
import 'package:http/http.dart'; | ||
|
||
// Ultroid | ||
export 'package:ultroid_cli/help.dart'; | ||
export 'package:ultroid_cli/init.dart'; | ||
export 'package:ultroid_cli/version.dart'; | ||
export 'package:ultroid_cli/run.dart'; | ||
export 'package:ultroid_cli/upgrade.dart'; | ||
export 'package:ultroid_cli/delete.dart'; | ||
|
||
|
||
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.0') { | ||
print( | ||
" ${Colorize('╔══════════════════════════════════════════════════════════════════════════╗').cyan()}\n" | ||
" ${Colorize('║').cyan()} A new version of UltroidCli is available! ${Colorize('║').cyan()}\n" | ||
" ${Colorize('║').cyan()} ${Colorize('║').cyan()}\n" | ||
" ${Colorize('║').cyan()} Please download the lastest release. ${Colorize('║').cyan()}\n" | ||
" ${Colorize('╚══════════════════════════════════════════════════════════════════════════╝').cyan()}" | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// 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 runUltroid() async { | ||
final rootDirectory = Directory('./TeamUltroid'); | ||
if (!rootDirectory.existsSync()) { | ||
print( | ||
"[ ${Colorize('root://TeamUltroid').lightMagenta()} ] does not exists.\n" | ||
"Run [ ${Colorize('ultroid init').lightGreen()} ] first to install the repository and dependencies." | ||
); | ||
exit(1); | ||
} | ||
if (!File('./TeamUltroid/.env').existsSync()) { | ||
print( | ||
Colorize("Please create the file [ ${Colorize('root://TeamUltroid/.env').lightMagenta()} ]") | ||
); | ||
exit(1); | ||
} | ||
await Process.start( | ||
'python', ['-m', 'pyUltroid'], | ||
runInShell: true, | ||
workingDirectory: rootDirectory.absolute.uri.toFilePath(), | ||
mode: ProcessStartMode.inheritStdio, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// 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'; | ||
|
||
// Ultroid | ||
import 'package:ultroid_cli/version.dart'; | ||
|
||
void upgradeUltoid() async { | ||
final rootDirectory = Directory('./TeamUltroid'); | ||
if (!rootDirectory.existsSync()) { | ||
print( | ||
"[ ${Colorize('root://TeamUltroid').lightMagenta()} ] does not exists.\n" | ||
"Run [ ${Colorize('ultroid init').lightGreen()} ] first to install the repository and dependencies." | ||
); | ||
exit(1); | ||
} | ||
await rootDirectory.delete(recursive: true); | ||
print(Colorize('Installing Upgraded Ultroid to [ ').cyan().toString() + Colorize('root://TeamUltroid').lightMagenta().toString() + Colorize(' ]').cyan().toString()); | ||
await Process.run('git', ['clone', 'https://github.com/TeamUltroid/Ultroid', 'TeamUltroid'], runInShell: true); | ||
print( | ||
"${Colorize('Installing Ultroid Dependencies [ ').cyan()}" | ||
"${Colorize('root://TeamUltroid/requirements.txt, root://TeamUltroid/package.json').lightMagenta()}" | ||
"${Colorize(' ]').cyan()}" | ||
); | ||
await Process.run( | ||
'pip', ['install', '-r', '-U', 'requirements.txt'], | ||
runInShell: true, | ||
workingDirectory: rootDirectory.absolute.uri.toFilePath() | ||
); | ||
await Process.run( | ||
'npm', ['install'], | ||
runInShell: true, | ||
workingDirectory: rootDirectory.absolute.uri.toFilePath() | ||
); | ||
print( | ||
"${Colorize('Successfully Installed Ultroid Dependencies [ ').cyan()}" | ||
"${Colorize('root://TeamUltroid/requirements.txt, root://TeamUltroid/package.json').lightMagenta()}" | ||
"${Colorize(' ]').cyan()}" | ||
); | ||
print("Running [ ${Colorize('ultroid version').lightMagenta()} ]\n"); | ||
version(); | ||
print(Colorize('To Run Ultroid, Use The Command [ ultroid run ]').lightGreen()); | ||
} |
Oops, something went wrong.