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

pip install astra

Run

astra

Verify Installation

astra --version

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_shell-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_shell-0.1-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: astra_shell-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_shell-0.1.tar.gz
Algorithm Hash digest
SHA256 fcc8e2c7e7af8e3ae1f9911774a7411eb4cb9b435fa4df0770972645d9d57609
MD5 d456ab28292803a43c632d8a01339dbe
BLAKE2b-256 351aad1828e00b7a57f65108aa916bf47aebd7e3d304ee65f4731f54e8e7d24b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: astra_shell-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_shell-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 61d86b94ffe80d86a2d9ae6a80b143c06cc0f611281b67c8c3e32645c853e04e
MD5 329d519073f6ca01f75225d3d5c32956
BLAKE2b-256 33965eaf3b7e42c566692e125e74eb4fcd937e4cb2580f4569ba2f12fdf99d4a

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