[!Warning] This plugin requires the acodex-server NodeJS package to be installed and running on Termux.
AcodeX is a powerful and AI integrated terminal plugin with 70k++ downloads for Acode that enhances your coding productivity by adding in-app Termux terminal integration. With AcodeX, you can execute terminal commands directly from within the Acode app, eliminating the need to switch between apps for coding and terminal access.
[!Note] When starting a new terminal, be sure to adjust the terminal panel according to your screen. You can drag it to your desired position, and it will automatically adjust the columns and rows according to your screen size.
For previous change logs/updates, visit: Change Log
User-Friendly Terminal: AcodeX provides a seamless terminal experience within Acode. You can open the terminal panel with a simple Ctrl+K
shortcut or by searching for "Open Terminal" in the command palette.
Integrated AI: if you don't know any command, just ask the ai and ai will weite it
Enhanced Productivity: With AcodeX, developers can save time by executing commands directly within Acode, eliminating the need to switch between multiple applications.
Customizable Terminal Panel: The terminal panel in AcodeX is fully customizable. You can easily move, resize, minimize, or maximize it to suit your workflow.
Intuitive Interface: AcodeX offers an intuitive and user-friendly interface suitable for developers of all skill levels.
Tailored to Your Preferences: Customize the AcodeX terminal to match your personal preferences, making it your own.
Efficient Session Management: Create and manage multiple sessions efficiently, minimizing resource consumption and power usage.
Background Persistence: AcodeX ensures that your terminal session stays active even if you close Acode. When you reopen Acode, you can continue seamlessly without interruption.
Easy Directory Navigation: Navigate to any folder with a simple button click, simplifying directory changes.
Beautiful Themes: AcodeX comes with a selection of stunning themes (10+) to personalize your coding environment.
Transparency Options: Customize the terminal panel's transparency to your liking, adding a touch of visual elegance to your workspace.
Nerd Fonts Support: Preloaded with a collection of Nerd Fonts and the ability to load your own custom fonts, ensuring your terminal looks and feels the way you want.
Keyboard Shortcuts: Perform mouse-like tasks using keyboard shortcuts, streamlining your workflow and boosting efficiency.
Extensible: AcodeX is highly pluggable, allowing other plugins to harness its API for creating innovative extensions and enhancing functionality.
Easy Search: Easily search inside the terminal
Supports image rendering but by default its disabled
To use AcodeX, you need to have the Termux app installed on your Android device. However, you don't need to switch between apps to use the terminal, as AcodeX offers a convenient way to access the terminal directly within the Acode app with the help of Termux.
Install the plugin in the Acode App from Acode > Settings > Plugins > AcodeX
.
Install the server in Termux using the following command:
curl -sL https://raw.githubusercontent.com/bajrangCoder/acode-plugin-acodex/main/installServer.sh | bash
or
pkg update && pkg upgrade -y
pkg install python nodejs -y
npm i -g acodex-server
Basically just install python
& nodejs
and then just install acodex-server
npm package globally
But if you are installing it on termux then make sure to run this command first to bypass the termux specific issue:
cd $HOME && mkdir -p .gyp && echo "{'variables': {'android_ndk_path': ''}}" > .gyp/include.gypi
[!Note] You can uninstall python after successful installation of
acodex-server
Tutorial link: https://youtu.be/sXlIhrbpjyw
acodeX-server
.Ctrl+K
or search for "Open Terminal"
in the command palette (press Ctrl+Shift+P
to open the command palette).+
icon to create new session Ctrl-Shift-T
to show it.β
button is for closing the terminal.AcodeX provides some additional Keybindings for easy usability of terminal features.
[!Note] These keybindings will only work if you will use these inside terminal only. except the * marked one
Following are the supported Keybindings :
To leverage the power of artificial intelligence within AcodeX Terminal
Plugin, follow these steps:
Obtain API Key: Before using the AI capabilities, you need to acquire an API key for the respective model you wish to utilize. Visit the website of your chosen model and obtain the API key. Once obtained, navigate to the AcodeX settings and input the API key. Additionally, you can select your preferred model from the list of currently supported models, which include:
Accessing AI in the Terminal:
#
. This action will prompt a popup window to appear.[!Warning] Avoid prompts that may lead the AI to provide descriptive or explanatory responses instead of actionable commands.
[!Note] Use AI wisely, as there may be token limits associated with your API key. Be mindful of your usage to avoid exceeding token limits and potential interruptions in service.
We value your feedback! Please provide any suggestions or feedback to help us improve the AI integration and suggest additional AI models for future enhancements.
Stay tuned for more AI integrations and improvements coming soon π!
The acodex
plugin provides a set of api to interact with the AcodeX terminal.
execute(cmd: string, withEnter?: boolean = true) => void
Executes a command in the AcodeX terminal.
cmd
(string): The command to be executed.withEnter
(boolean, optional): Whether to append an Enter keypress. Defaults to true
.isMinimized() => boolean
Returns a boolean indicating whether the AcodeX terminal is currently minimized or not.
isTerminalOpened() => boolean
Returns a boolean indicating whether the AcodeX terminal is currently opened or not.
maximiseTerminal() => void
Maximizes the AcodeX terminal if it is opened and minimized.
openTerminal(termContainerHeight: number = 270, port: number = this.settings.port) => Promise<SessionAPI>
Opens the AcodeX terminal.
Parameters:
termContainerHeight
(number, optional): Height of the terminal container. Defaults to 270
.port
(number, optional): Port number for the terminal server. Defaults to the value from this.settings.port
.Returns:
Promise
resolving to a SessionAPI
object.createSession() => Promise<SessionAPI>
Creates a new terminal session.
Promise
resolving to a SessionAPI
object.changeSession(sessionName: string) => Promise<SessionAPI>
Changes the active terminal session.
Parameters:
sessionName
(string): Name of the session to switch to.Returns:
Promise
resolving to a SessionAPI
object.closeTerminal() => void
Closes the AcodeX terminal if it is opened.
convertAcodeUriToTermReadable(path: string) => string
Converts an Acode URI to a format readable by the terminal.
Parameters:
path
(string): Acode URI path.Returns:
addTheme(themeName: string, colorSchema: object) => void
Adds a new theme to the AcodeX terminal.
themeName
(string): Name of the theme.colorSchema
(object): Color schema object for the theme.applyTheme(themeName: string) => void
Applies a theme to the AcodeX terminal.
themeName
(string): Name of the theme to apply.The SessionAPI
object provides methods for interacting with the terminal session.
onmessage(callback: (data: string | Uint8Array) => void) => void
Registers a callback function to be called when a message is received form server.
callback
((data: string | Uint8Array) => void): Callback function to handle incoming messages.write(cmd: string, withEnter: boolean = true) => void
Writes/Executes a command to the terminal.
cmd
(string): The command to write.withEnter
(boolean, optional): Whether to append an Enter keypress. Defaults to true
.const acodex = acode.require("acodex");
acodex.execute("ls"); // execute the ls command in terminal
const isMinimized = acodex.isMinimized();
const isOpened = acodex.isTerminalOpened();
acodex.maximiseTerminal();
const session = await acodex.openTerminal();
session.onmessage(data => console.log(data));
session.write("ls");
const sessionSocket = await acodex.createSession();
sessionSocket.onmessage(data => console.log(data));
sessionSocket.write("ls");
const changeSessionSocket = await acodex.changeSession("AcodeX2");
changeSessionSocket.onmessage(data => console.log(data));
changeSessionSocket.write("ls");
acodex.closeTerminal();
const termReadablePath = acodex.convertAcodeUriToTermReadable("file://storage/emulated/0/myTheme/acode/file/path");
acodex.addTheme("myTheme", { background: "#fff", text: "#000" }); // you can find more colors in themes.js
acodex.applyTheme("myTheme");
Custom fonts are provided to load any other external fonts
To load a custom font:
css
file anywhere in the internal storage.@font-face {
font-family: "MesloLGS NF Regular";
src: url("./MesloLGS NF Regular.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
"Custom Font StyleSheet"
.AcodeX is made possible by the use of:
We welcome your suggestions for enhancing AcodeX. If you have an idea for a new feature or improvement, please consider opening a feature request on our GitHub Issues page. Be sure to provide detailed information about the feature you'd like to see, along with any use cases or scenarios that could benefit from it.
If you encounter any issues or unexpected behavior while using AcodeX, please help us by reporting the problem. To report a bug, visit our GitHub Issues page and create a new issue. Please include the following information in your bug report:
Your contributions are highly appreciated and welcome! You can contribute to the AcodeX Plugin in various ways:
Fork the Repository: Start by forking the AcodeX Plugin repository
Create an Issue: If you plan to add new features or fix a bug, it's a good practice to create an issue first. Describe the problem or feature you want to work on. This allows for discussion and collaboration with the maintainers.
Make Changes: After forking the repo, create a new branch, and start working on your changes.
Open a Pull Request: Once your changes are ready, open a pull request (PR) on the original repository. Reference the issue you created if relevant.
Code Review: Your PR will be reviewed by the maintainers, and feedback may be provided. Be prepared to make adjustments if needed.
Merge: Once your PR is approved, it will be merged into the main branch. Congratulations, your contribution is now part of AcodeX Plugin!
Fork it and Clone the repo
git clone https://github.com/bajrangCoder/acode-plugin-acodex.git
navigate to acodex directory and install the dependency
pnpm install
For building the plugin zip
pnpm build
[!Warning] You will need acodex-server NodeJS package to be installed and running on Termux to test the plugin.
You can also support the development of AcodeX Plugin by making a financial contribution. Donations help in maintenance and further development.
If you find AcodeX Plugin useful, consider giving it a star on GitHub. It's a simple way to show your appreciation and help others discover the project. and You can review AcodeX on https://acode.app
Your contributions, whether through code, financial support, or a simple star, make AcodeX Plugin better for the entire community. Thank you for your support!
β€οΈβ€οΈ Thanks for using AcodeX β€οΈβ€οΈ