GitGram
6 ������
������� ���� ���� � �������� ������ (��� ����������� � �������)
����� ������� � ����� @gitgram (������ ������ � ��������� ����)
�������: /init, /commit, /log, /ls, /status
������������ �������� � SQLite, ����� ���������� �����
��� ��� �����:
����������� (��������, �����)
������ ���� �� aiogram
���� ������ � ��������� ��� users, projects, files, commits, file_versions
������ ��������:
Markdown � Telegram � ��� ������. ��� ��������� �������� �������, ������� ����� ������������: �����, �������������, �������� �����. ���� �� ������������ ������ � ��� ������������ � ����. ���� �� ������������ � Telegram ��� �����. �������� ������ ���� �������, ������� ������� ���������� ����, ����� ������, � ��������� ��� ������ �� ���������.
python
def escape_markdown_v2(text: str) -> str:
"""���������� ��� ����������� MarkdownV2"""
special_chars = ['_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!']
for char in special_chars:
text = text.replace(char, f'\\{char}')
return text
def format_code(filename: str, content: str) -> str:
"""����������� ��� ��� �������� � Telegram � ���������� ����������"""
lang = get_language_from_filename(filename)
������:
�������� .gitignore (���� ���� � ��� �� ������ � �����)
������������ � ����� ��������� ������� ����� ������ ���� ������
��������� ������� (���� �� ���������)
�����? � ������� �����??
���� ������ �� ������ ������, � �������� ��� ��� ������� � ������ ������������ � ������� � ���: @sandbox_hardcore
��� �� ��� ����, ��� ������� � ��� �������.
��������� � ���� ������!)
����:
��� ��������, ��� ��� ���� ������������ ��� ����� � ����� � ������ �� �����.
������ �������� → ��� ����� ������ → ��� ����� → ��� ������.
������ ������� �����, ���� �� ������ �����. ������ ��������, ���� �� ���� �����.
������ �� �����:
�� � �����������:
���� ������� ����� → ��������� THROAT_CHECK
�� �������� ���� → ������� � ��������� DIAGNOSIS
���� ����� ������ → ������� � ��������� PAYMENT
�� �� ������ �������� � THROAT_CHECK ����� � PAYMENT (��� �� ������).
� ����:
�����:
FSM � ����� �� ������ �� �������������, ������� ������ ��� ��� ��������� ����������. ������� �������� ������� � ��� �������� �� ����� ��������.
���� ������ ������� �������� � FSM � ��������� ���. ��� ����, ������ ������� ���.
������, ������ ������ ��� ������� ��� GitGram, ��� ��� ���� � ����� �� ����� ��� ����� � ��.
����� ����, �� ��� �����, ��� �����������!
������� �������,���� ��� �� �������� ��� �����, ����������, ������ ����������� ������.
����� ����� ������� �������� ���������� ������ � ���� ����� � ����� ������ �� �����, �� ������ �����, �� ���������� �����.
�������� ���, ������� ������ �������� � /commit, /rm, /branch, /checkout...
� ��� ���� �������:
�� ��� �� ��� ��������, ����!
� ������ ������. ��� ������ ������ �������.
������ ��� �����:
�� ������ � ������� ��������� � owner_id � ����. � ��� ������ ������ ������ ��� "�������", ���� �� ���� �������. � ��������� � ��� � ���� �� ����� ������.
��� ������� ���� ����������� �� owner_id: /list � ������ ��� ������� /use ����� � "������ �� ������" /commit, /rm, /branch � ���� �� ������� �� ����������, ������ ��� ������ ����� �� �������
��������� � ������� ����:
/list � ���� ������ ���� �������
/use ���_������ � ❌ "������ �� ������"
/commit � ��� ���� �� ��������, ������ ��� ������� ���
����: ����� ������������ � � ��� ��� ���� ����� � ����������� � ������� ���.
����� ��� "�� ���, � ����" �����. ������ ����� ������� ������ � ����� �������.
����� ����� ���������, ������� �� ������
��� ����� � sandbox � ������ �������� � ���������: @sandbox_hardcore
������, ������ ������ ��� ������� ��� GitGram, ��� ��� ���� � ����� �� ����� ��� ����� � ��.
����� ����, �� ��� �����, ��� �����������!
������� �������,���� ��� �� �������� ��� �����, ����������, ������ ����������� ������.
���� ������, �����!
��������� ������ Gitgram � ��� ��� �������� �����������: ����������� git-�������� ����������� ����� ������ Telegram-����. ��� GitHub, ��� ��������, �� ����� ������� � ����.
������� ��������� ������ ����� � ������ ����� ���������, ������������� � ������ ������. ��� ��� ����������:
��� �������:
������� ���� current_branch � ������� projects
������ ����� ������� branches:
������� ������� get_current_branch(project_id) � ���������� ������� �����, �� ��������� main
������� /branches � ���������� ��� ����� ������� + �������� �������. ���� ����� ��� � ��������� ������ main
������� /branch <name> � ������ ����� ����� (� ���������, ��� ����� ��� ���)
������� /checkout <name> � ������������� �� ����� (��������� current_branch � ����)
��� ���: sqlite3.OperationalError: no such column: current_branch ����� ���������: ������ ������ ����, ������������ ���� � ������� ���������� �������������. ������ ����� �� ������, ��� ������� �������� 😅
�����: ������ ����� test → ������������ → /branches ������� �� ��� ����. �������� �������!
��������� ������ � ����� � � ��� ����-��������, ��� �� ������ ���� ���������.
������ Gitgram ����� ����� � ��������� ��� ����� diffs (��������� ������ ����� ���������/�������), �� ��� ��� ������.
��� �������?
��������� �� �������� ���� git � Telegram?
����� �� ������ ������ PR/merge/issues?
��� ��� ��� ������� � ���� �� ���� ������������? 😄
������ � ���������, ��� ������ ������ � ���� ������� ����������� � ��������� �����.
���������� ��� ��� ��� ����� �������������:
��� � 10 ����� ������ CoinGecko API
��������� �����, ����� �� ����������
��������� BTC � USD � ������� � �� ������ ������ ��� ������
�� ����� � �����: �����, ����� ��� ����, ����� ������ ����� � ���� ��� � ������!�
CoinGecko � ����, ��� ��� ����������. �������� ���������� Binance.
��� ������:
�������� ������ � �������� �������
����� ���, ������� �� ������
��� �������:
��������, ������� ������ � ��������������� ��������
����������� �������
�� ����� �� ��������, � �� ������� � SyntaxError � ������:
��� ������:
������ �� ��� ������, ��� ������ � ������:
�����:
��������� ���� ≠ ���������. ������ � ��� ������.
������� ������ �� BTC, ������� � ��������� � ��������� �������.
� ��� ��������?
���������, ��������� ������������� ��� �����:
��� �������:
������ ���������� ���������:
����:
JSON � datetime � ������ ����.
�������� ������ ���� � ������ �� ����� �������.
����:
��� ��������:
�������:
������� � systemd:
� ������ �������� 2 ������ � Telegram API ����������� �����.
����� ETH ���������� �� 7%, ��� ����� ����� �����:
��� ��������:
������� ���������� � ����� ������������:
�����:
��� ����������� ��� ������������ � ������-�������.
✅ ������ � �������� ������� � WebSocket �����
✅ ����� �����������
✅ ���������� ������ � ����� ����� ��������
������� �� � ��� ����� �� � ����.
�������� �� ������� � �������� ≠ ���������.
�� ������� datetime � JSON ��� ���������.
systemd � ����� � ������� �������� ���� �����.
������� ����:
����� ��� �������� � ������� ���� � ������, �� ���-�� �����.�
P.S. ������ ��������! ���������������� � ����������� ������� ��������������!🚀
��� �� ����������
� ��������-������ ���������� ������� ����� ��������: ������� Git � Telegram. ����� ����� ���� ����� ���� ������� �������, ������ �����, ��������� � � �� ��� � ��������� ������ � �������.
�������� ������
������� ����� �� � JSON ������. ��� ��� �������� � �����, ��� ��� ������. ������������ ������, ����������� ������, ������������ � JSON ��� ������ �� ������������.
������� �� SQLite. ������, ������, ���������� ����, �� � ����� �����.
�������� ��������:
users � ��� �����
projects � ������� (��������� � ����� � ������)
files � ����� ������ �������
file_versions � ��� ������ ������ (���� ������������ ����� ����)
commits � �������
commit_files � ������ �������� � �������� ������
� ���� ���� ����������, ���� �� ������� ������� �� SQL. ������ �� ���� ������������ ���������� �������, IDE ������������, ���� ��������������.
� ������������ ���������
�������� ��, ��� ����� ���� �����: ������� ��� � ������� ���������, ������ ���� � � Telegram ��� ���������.
� ������.
�� �������� Telegram ���������� ���� ������� Markdown, ��� ���� ��������� ��������: _, *, [, ], (, ), ~, >, #, +, -, =, |, {, }, ., ! � � �� ���� ������������.
� ���� ��� ������� ����������� �� ������ ����.
������������ ���� ��������� �������������:
������������ �� ������ � ��� ������������ � ����
�� ������������ � Telegram ��� �����
������������ ������ ���������� ����� � �� ����� �������� ������
� �����-�� ������ ������ ����� �� Markdown � ������� �� HTML. Telegram ����� ��������� HTML. ��, �� �� ����� ��������, �� ���� �������������.
��. ������� �����, �������������, �������� ������. ��� ������� � � ��� ����� ��� ����.
����� �������, ������� �������� ����
����� ��� ����� ��������� ���������, ��������� � ������������. ����� ������ �������� � ������ �������:
������� � /commit, ����� � /rm, ����� � /branch... � ��� �� ���� �����.
��� ��� ��������. � ������ ������.
� ������ �����, ��� ������������� ���� ������. � ������� projects ���� ���� owner_id, � ��� ������� ����������� �� ����. �������� ������� � ������ ����. ����� ���� � ������ � �����. ������� ������ � ������ �� �����.
�������
����� ����� ������ 5-6. ��� ��� ��� ��� �������:
/start, /init, /use, /list, /ls, /commit, /log, /status, /rm, /rmproject, /rmproject_confirm, /ignore, /ignored, /unignore, /branch, /branches, /checkout, /diff, /cat
� ��� �� ������. ������� ��� /tree ��������, ������������, ��������� �������... � ��� ����� � �� �������� ���� ����� � ���� ��������� ����� � ����, ���� ��� ������������� �� ������ �� Telegram.
��� � �����
GitGram ���� � ��������. ��� ��������� �����, ������� �����, ����� �������������, ����� ������������. �� � ������, ������ ������ ��������.
��� ����� ������ � �����-�����������: @Git_Gram
���: t.me/Git_GramBOT
��� ���������� ������� ���!
��, �� �������� GitGram ����� �� �����. ���� GitHub, GitLab, ���� ���������� ������������. �� ���� ������� ����������.
��� ���?
���������� � ������������, ������� ���-��������� ��� API�.
������������ � �Pydantic + Starlette + ���� �����, ������� ������� ��� ����.
FastAPI ��� ��� ��� ������� ������ "�� �� ��� ��,�� ��������� �� �����..", � ����� ������ 500-���������� ������������ � ��������� �� async/await.
1. ����� �� ������� � Flask
� ���������� ��������� (�� ���� ��� JSON ������� �name: str�, ���������� � ������-��������).
� ���������������� (Swagger, ������� ����������� �� ����� �������).
� ������������� (�� ���� �� �� ������, ��� async def ���������� �� def � ��� ������).
2. ����� ��� �� ����� �� ������� �� �������
� ��������� �� ����� (�� ���� �������� ������ "price": "��� �����", �� �� ����� �������� 422 Unprocessable Entity).
� ����������� (����� ������, ��� ��� ������ ����������� � �������� �������).
3. ����� ��������� ����� �� �������������
� ���, � ������� � FastAPI� → ��, �� ������ Pydantic?� → ������.
✅ ���� ��� API ������� �������, ��� (�� �����, ��� ��������� ��� ������������� �������).
✅ ���� ������ �������������� ������������ (�� ������� ���� �����).
✅ ���� ������ � ����, ��� async/await � ��� �� ������ ������ �����.
❌ ���� ��� API � ��� ���� ����� GET /hello.
❌ ���� �� �������, ��� ������� ������ ��� ���� ������������.
❌ ���� ������� ����� �Dependency Injection�.
��� ����� ����� ����� �� ���?
� price: float, � ��� ������� "price": "������ ������" → 422.
� �������� async → ������, �� �� ����� (�������, Python).
� ������ ���������� SQLAlchemy → ������, ����������� ��.
FastAPI � ��� �����, ��:
� ������� ������� �����.
� ������ ����� �������.
� ����� ������ ��� ���� ������� ��� ������� ���.
���������� ��� ������� � ���� � ��-������


� ������ ���� ���������� ������. ������, ��. ������ ���:
✔️ ���� ������
✔️ ���� �������
✔️ � ��� ��� ��������
��� �� ��������? � 2026 ���� �������� ������ �� ���/���?
��� �� �����, ��� �����.
� ������� ���� ��� �������,������� ����� ������ ��������� �� ����:
� ������ ������� � → ������� �����������.
� ������ � → ����� �� ������ �����.
� ��� �������� ������� � ����������.
������ �� ����� ������ ��� ����������:
�������� ����� ��� ��� �������?�



������������
�������� �����
└─ �) ���-��������
└─ �) ��������
└─ �) �����������
�����
└─ �����
└─ ���-���
└─ ����� (����. ��� ���)
���� ������, ��� ���� �� �� ����, � ����� � ������ ����������:
� �������� � ���� JSON-���� �� ���������� ������ → �� ������� ������ → ����� � ����� → ���������� ������ � ���� � ��� ��������.
�� ����� ��� �����, �� �������� ��!!!
��������:
������ ����� ���� � �����/���?
������ ����:
� ������� ��� � �����������
� ����������� � JSON-�����
� ������ �������
� �������� ���� �� �����
� � �����, ��� ��� ��������.
�������:
���� ���� ���� ������ 100 ������ � ����� �������!!!
����� ����� ����� ������ ������ �����, �������� ������� � ������������� � ������� ������.
��� ����.
��� JSON.
��� ������ � ������.
� ���� � ��-������ ���� �������� ��� ����,���������� ������ � �����������
��� ���, ����������, �� ������.
�� ���� �� �����, � �� ����������� � ������ ������� ����, ���� � �����: ��� ���� �� ������ ���.
P.S.
���������� ������ �� � ��� �������, ��� �� ���� �������.
��� ��� � ��� ��������.
� �������� ������ �������� ����.
������ ����� ����� � ���� �����?
��� ����� � ���������. ��� ������ �������. � �� ����.
