Skip to main content

Modern Python REPL with plugins, aliases, sessions and AI support

Project description

Astra REPL v0.1

Modern Python REPL with AI support, shell commands, plugins, aliases, sessions, inspection tools, benchmarking and developer utilities.

Astra REPL is an extensible interactive Python environment designed for developers, students, researchers and power users. It combines a Python interpreter, shell utilities, project tools, plugin architecture and AI-assisted development in a single terminal application.


Features

  • Python REPL

  • Interactive Python execution

  • Multi-line code execution

  • Persistent environment

  • Variable management

  • Function and class support

  • Command history

  • Session save/load

AI Assistant

  • Ask programming questions

  • Explain code

  • Fix bugs

  • Review source code

  • Generate complete programs

  • Save AI responses

  • Save generated code

Shell Integration

  • Directory navigation

  • File management

  • Tree view

  • File reading

  • Terminal utilities

Plugin System

  • Dynamic plugin loading

  • Plugin creation wizard

  • Plugin editing

  • Plugin reloading

  • Plugin autoload support

Developer Tools

  • Benchmarking

  • Memory inspection

  • Environment statistics

  • Object inspection

  • JSON export

  • CSV export

Themes

  • Dark

  • Light

  • Matrix

  • Hacker

  • Neon


Installation

PyPI

pkg install python-psutil
pip install astra-console

Run

astra

Installation From Source

git clone https://github.com/umidjon-mamadjanov/Astra.git


cd Astra

pip install -r requirements.txt

pip install -e .

Run:

astra

Requirements

Python 3.10+

pip

Internet connection (for AI features)


Quick Start

Variables

x = 100

x

Output:

100

Loops

for i in range(5):
    print(i)

Output:

0
1
2
3
4

Functions

def hello():
    print("Hello Astra")

hello()

Output:

Hello Astra


Shell Commands

Command Description

  • ls List files
  • cd DIR Change directory
  • pwd Current directory
  • cat FILE Show file
  • mkdir DIR Create directory
  • touch FILE Create file
  • rm FILE Delete file
  • tree Directory tree
  • clear Clear screen
  • astrafetch System information

Examples:

ls

cd plugins

pwd

cat test.py

mkdir project

touch main.py

tree

AI Commands

Ask AI

/ask Python nima?

Explain Code

/explain print("Hello")

Fix Code

/fix pritn("Hello")

Review Code

/review print("Hello")

Generate Code

/generate calculator in python


AI Response Saving

Save last AI response:

/save answer.txt

Save code block:

/savecode app.py


AI Models

List models:

/models

Current model:

/model

Change model:

/use 1

AI status:

/ai-status

Shows:

  • Provider

  • Current model

  • API status


File Management

Edit File

/edit app.py

Finish with:

END

View File

/view app.py

Run File

/run app.py

Install Package

/install requests


Search

Search project files:

/find TODO

/find AstraREPL

Supported:

  • .py

  • .txt

  • .md

  • .json


Plugin System

Create Plugin

/plugin-create hello

Generated template:

def run(args=""):
    print(args if args else "hello plugin")

Show Plugin

/plugin-show hello

Edit Plugin

/plugin-edit hello

Finish editing:

END

Load Plugin

/load hello

Execute Plugin

/exec hello

/exec hello test

Unload Plugin

/unload hello

Reload Plugin

/reload hello

Reload All

/reload-all


Plugin Autoload

Add:

/autoload hello

Remove:

/unautoload hello

List:

/autoload-list


Themes

Show themes:

/theme list

Change theme:

/theme hacker

/theme matrix

/theme neon

Aliases

Create alias:

/alias ll ls

Usage:

ll

List aliases:

/aliases

Remove alias:

/unalias ll


Environment Commands

Show Objects

%who

Detailed Objects

%whos

Variables Only

%vars

Environment Statistics

%env

Reset Environment

%reset

Measure Time

%time sum(range(100000))

History

%history

%history 10

%history clear

Memory Inspection

Process memory:

%mem

Object memory:

%mem data


Benchmarking

%bench sum(range(1000000))

Results:

  • Runs

  • Average

  • Fastest

  • Slowest


System Information

%sys

Shows:

  • CPU Cores

  • RAM Total

  • RAM Used

  • RAM Free


Sessions

Save:

%save-session work.astra

Load:

%load-session work.astra


Variable Management

Delete:

%del x

Rename:

%rename x number

Copy:

%copy data backup

Clear variables:

%clear-vars

Protected objects:

  • Modules

  • Functions

  • Classes

  • System variables


JSON Export

Print JSON:

%json user

Save JSON:

%json user user.json


CSV Export

Print CSV:

%csv students

Save CSV:

%csv students students.csv

Example:

students = [
    ["Name", "Age"],
    ["Umidjon", 15]
]

Inspection

Quick inspection:

str?

list?

dict?

x?

Full inspection:

str??

list??

dict??

System Commands

Configuration:

/config

Statistics:

/stats

Locate command:

/which ls

/which hello

Version:

/version

System info:

/sysinfo

Backup configuration:

/backup-config


Shortcuts

Quick menu:

//

Help:

/help

Exit:

exit

Project Structure

Astra/
│
├── ai/
├── core/
├── plugins/
├── themes/
├── sessions/
├── config/
├── main.py
├── requirements.txt
├── pyproject.toml
└── README.md

Roadmap

v0.2

  • Better plugin API

  • Auto-completion improvements

  • More AI providers

  • Syntax diagnostics

v0.3

  • Workspace support

  • Package manager

  • Project templates

v0.4

  • Stable public release

  • Full documentation

  • Plugin marketplace

  • Cloud sync


Contributing

  1. Fork repository

  2. Create branch

  3. Make changes

  4. Commit

  5. Open pull request


License

MIT License


Author

Umidjon Mamadjanov


Version

Astra REPL v0.1

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

astra_console-0.1.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

astra_console-0.1-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file astra_console-0.1.tar.gz.

File metadata

  • Download URL: astra_console-0.1.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for astra_console-0.1.tar.gz
Algorithm Hash digest
SHA256 d8ad792d924f385b6b318038cb934d61bbedb1ead14e88fb20da125492eb4515
MD5 6104657a153e2d2c63e60af0dc9f12c8
BLAKE2b-256 764208faabe4fa4d969416be7a5e7a66adb24401fa3b0784e8a1517165eb247b

See more details on using hashes here.

File details

Details for the file astra_console-0.1-py3-none-any.whl.

File metadata

  • Download URL: astra_console-0.1-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for astra_console-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f761b4b86cebbbf1e0822fd47930f21c344bc23edddac91a87e932faa22b41cf
MD5 e4527b621586e1bffd7b86ac535a94f7
BLAKE2b-256 49a5c3d5a3904d54890d3c92aa287a375bd58765bc0c70385618b163aebeeb55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page